Starlit Daily

📚 › JavaScript: make pages do things

2. Variables: let and const

Este artículo se traducirá automáticamente. Por ahora se muestra en inglés.

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.

Ver ejemplo

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

✍️ Ahora te toca

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

← Volver al curso