Wednesday, November 24, 2021

let and const

 let and const are different ways of creating variables. As we know we create variable by using keyword var. 

e.g. var name ="suraj" ;

With ES6 two different keyword were introduced let and const, var still works but you are highly encourage to use let and const.

* let: let is new var, its generally create variables like var. Its value is changeable
* const: const is a way of declaring variable when the value is not going to change                 and will remain same

No comments:

Post a Comment

let and const

  let and const are different ways of creating variables. As we know we create variable by using keyword var.  e.g. var name ="suraj...