Pergunta de entrevista da empresa ABB

The difference between let, var and const

Resposta da entrevista

Sigiloso

16 de dez. de 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)