Variables are containers for values — you give a value a name so you can reuse it later.
let age = 25
console.log(age) // 25
age = 26 // changing the value is allowed
console.log(age) // 26
Use let when the value might change later.
Use const when the value should stay fixed:
const PI = 3.14159
PI = 3 // ❌ Error! const cannot be reassigned
const name = "Alice"
console.log("Hello,", name) // Hello, Alice
Rule of thumb: Always use const, and switch to let only when you need to reassign the value.
Create two variables:
name with your name (or any name)age with an ageThen print: My name is [name] and I am [age] years old.
Click "Run" to execute your code.