JavaScript Fundamentals — Free Sample

A 5-question sample covering JavaScript language semantics — variable declaration scoping (var vs let/const), closures over loop variables, async/await behavior, this binding in arrow vs regular functions, and the spread/rest operator. Items focus on conceptual understanding rather than code-tracing — that's reserved for the full 50-question assessment. For a verified Skills Passport credential, take the full assessment.

1. What's the difference between `var`, `let`, and `const` in JavaScript with respect to scoping?
2. Which of these correctly captures each loop-iteration's value in the closure passed to `setTimeout`?
3. What does `await` do inside an `async` function?
4. How does `this` binding differ between an arrow function and a regular function in JavaScript?
5. What's the difference between the spread operator (`...arr`) used in an array literal and the rest operator (`...args`) used in a function parameter list?