1. What is the scope of a variable declared using let?
- Global scope
- Function scope
- Block scope
- Module scope
Reveal sample answer and explanation
Answer: Block scope
Variables declared with let are block-scoped.
This JavaScript Intermediate Quiz is designed for developers who already understand the basics and want to test real-world JavaScript concepts. It covers arrays, objects, functions, scope, DOM manipulation, async behavior, and interview-relevant logic.
The question bank contains 49 questions. Your scored round uses up to 15 different questions. These samples are excluded from your round; try each one before opening its answer and explanation.
Answer: Block scope
Variables declared with let are block-scoped.
Answer: slice()
slice() returns a shallow copy of an array.
Answer: number
NaN is considered a number type in JavaScript.