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.

عرض المثال

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

✍️ دورك الآن

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

← العودة إلى الدورة