Question 3 of 8Pro Only
What are the differences between var, let, and const in JavaScript, and when should you use each?
Sample answer preview
The three keywords differ along three axes: scope, reassignment, and redeclaration. Scope is the most consequential. var is function-scoped, meaning it is visible throughout the entire function that contains it regardless of which block it was declared in.
function scopeblock scopereassignmentredeclarationObject.freezeTemporal Dead Zone