Which statement about var, let, and const is true?

Prepare for the TJR Bootcamp Test with flashcards and detailed questions. Get hints and explanations for each query. Ace your exam!

Multiple Choice

Which statement about var, let, and const is true?

In JavaScript, how a variable is declared affects where it’s accessible and whether its binding can change. Let creates a block-scoped binding, and that binding can be reassigned over time. For example, let x = 1; x = 2; is valid, illustrating reassignment. The same block cannot have another declaration of the same name with let, so redeclaration in the same scope isn’t allowed.

This aligns with the statement that describes let as block-scoped and capable of reassignment, making it the true description. By contrast, var is function-scoped and can be redeclared in the same scope, const is block-scoped but cannot be reassigned (though objects declared with const can have their internal properties mutated).

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy