Account
Categories

let


Definition:

It is a place where you can store values while the program runs.

You can change its value at any time in the program.

You can use it only inside the block {} where it is declared.

It stores the value of any type, such as a number, a string, an array, or a boolean.

Variable Name              Value
Raj
---------->
5
name
---------->
"Ravi"
isStudent
---------->
true

Syntax:

let variableName = value;

Example:

let name = 5;       // number value
let name = "Ravi";   // string value
let isStudent = true; // boolean value