Variables (let, const, var)
Variables are containers for storing data values. JavaScript has three ways to declare variables: let, const, and var.
let - Block-Scoped Variables
Use let for variables that can be reassigned:
Loading JavaScript Playground...
const - Constants
Use const for values that shouldn't change:
Loading JavaScript Playground...
var - Legacy Variables
var is the old way to declare variables. Prefer let and const instead:
Loading JavaScript Playground...
Naming Rules
Variable names must follow these rules:
Loading JavaScript Playground...
Exercise: Create Variables
Create three variables and print them:
Loading JavaScript Exercise...
Exercise: Const vs Let
Use const for a fixed value and let for a changing value:
Loading JavaScript Exercise...

