Starlit Daily

📚 › JavaScript: make pages do things

2. Variables: let and const

A variable stores a value under a name. const is for a value that never changes; let is for a value that can change.

Names can contain letters, digits and underscores, but cannot start with a digit.

Show example

const city = "Dhaka";
let visitors = 10;
visitors = visitors + 5;
console.log(city, visitors);

✍️ Your turn

Create a variable name holding Rahim and print: Hi Rahim.

← Back to course