Web Technology
primer-original-v2easyJavaScriptVariablesScopeletvarprimer-original-v2

What is the key scoping difference between 'let' and 'var' in JavaScript?

Answer options

A
let is function-scoped; var is block-scoped
B
let is block-scoped; var is function-scoped
C
Both are block-scoped but let cannot be reassigned
D
var is deprecated and cannot be used

Correct answer: let is block-scoped; var is function-scoped

Detailed Solution & Conceptual Analysis

This question has been retained as-is due to its unique context.

Key Engineering Takeaway

In Web Technology, understanding the underlying mechanics of JavaScript is critical for writing performant, bug-free production code and passing rigorous technical architecture reviews.

Related Web Technology questions

Practice more Web Technology questions

PrimerPrep has independently reviewed practice questions and coding exercises — all free.