JavaScript ES6+ Quiz
Modern JavaScript added a lot of useful syntax: destructuring, spread and rest, optional chaining (?.), nullish coalescing (??), Map and Set.
These questions check you know exactly how they behave, especially with null and undefined.
ES6+ questions
- Does the spread operator make a deep copy?
- When do default parameters apply in JavaScript?
- What is the difference between ?? and || in JavaScript?
- How does optional chaining short-circuit in JavaScript?
- When do destructuring default values apply?
- How do you swap two variables with destructuring?
- How do you remove duplicates from an array with Set?
- What does the rest operator do in object destructuring?
- Why can a Map have both 1 and "1" as keys?
- What does Array.from({ length: 3 }) create?