Skip to content

EasyConceptJavaScript

What is the difference between var, let and const?

What a good answer covers

var is function-scoped, hoisted and initialised as undefined, and can be redeclared. let and const are block-scoped and live in the temporal dead zone until declared. const prevents reassignment of the binding, not mutation of the object it holds.

More on JavaScript

Flashcards for this topic