DEV Community

Nimal Anand
Nimal Anand

Posted on

Variable declaration

we use three identifiers in java script var,let,Const.
var means variable. By using var we can declare redeclare and reinitiate values for a variable .
example: var x =5
var x=6
x =7
if we use let and declare a variable then we can declare it once and we cant redeclare it again but we can reinitiate it again.
example: let x =5
x=6
if we use const we can declare the variable only once we cant redeclare and reinitiate it again.we declare the data also while declaring the const.
const m=5.

Top comments (0)