+2 votes
in JavaScript by
What is let and const in javascript?

1 Answer

0 votes
by

In modern javascript let & const are different ways of creating variables. Earlier in javascript, we use the var keyword for creating variables. let & const keyword is introduced in version ES6 with the vision of creating two different types of variables in javascript one is immutable and other is mutable.
const: It is used to create an immutable variable. Immutable variables are variables whose value is never changed in the complete life cycle of the program.
let: let is used to create a mutable variable. Mutable variables are normal variables like var that can be changed any number of time.

Related questions

+1 vote
asked Jul 16, 2019 in JavaScript by Indian
0 votes
asked Mar 10 in JavaScript by DavidAnderson
...