P3.1: JavaScript Basics & Variables
JavaScript is the programming language of the web. It controls the interactive behavior of websites.
1. Declaring Variables
Modern JavaScript uses let and const to store variables:
const(Constant): Sourced for variables that should never change.let: Sourced for variables that will be reassigned.- Never use
var: It has outdated scoping behaviors.

Kyle SimpsonView Profile 🔗
Real-World Developer Case Study RoleAuthor of You Don't Know JS
Salary₹85 Lakhs/yr equivalent
CompanyGetify Solutions
Core Tech Stack
JavaScript CoreScopesClosuresAsync JS
“Don't just write code; know how the compiler works. Const signifies that the variable reference will never be reassigned. Use it by default, and change to let only when required.”
2. Core Data Types
- String:
"Hello" - Number:
42,3.14 - Boolean:
true/false - Null: Represents an intentional empty value.
- Undefined: Variable declared but not assigned.
🎓 Practice Assignment
- Open your browser console.
- Create variables representing your name (
const), age (let), and student status (const). - Log them to the console.