ABB interview question

The difference between let, var and const

Interview Answer

Anonymous

16 Dec 2024

Main differences: 1) let and const have a block-scope, var - function-scope 2) let and var can be reassigned, const - can't 3) var hoists to the top of its scope but initializes with undefined, let and const hoist but don't initialize (we will get referenceError)