PROGRAMING
Variable is named of computer memory location. Which hold value in computer memory.
There are few reserved words for declare variable in JavaScript. These have mentioned in below
let have local scope and global scope. Suppose u have declared name variable top of the program and same variable have declared in the function both will work correctly. Since they have different scope.
Same conditions will work for var and const.
But difference is let and const have block scope. Dont have block scope for var.
Lets clear by an example. Suppose u have declared name variable top of the program and same variable has been using in the loop. There u will face value related problem because var dont have block scope. Which have in let and const and thats why arisen issue will solve by let and const .
Read what excites, achieves and moves us Read what excites, achieves and moves us