A variable is a container used to store data values. In JavaScript, variables allow you to store, update, and use data throughout your program.
JavaScript provides three ways to declare variables:
var name = "Ahmed";
let age = 25;
const country = "Egypt";
age = 26; // allowed
// country = "USA"; โ not allowed
let and const instead of var.
Click the button to create variables and display them: