ES6 Interview Questions and Answers
ES6+ features define how modern JavaScript is written. These are the questions interviewers ask about them.
What is destructuring?
Syntax to unpack values from arrays/objects into variables, with defaults, renaming and rest. It's everywhere in function params and React.
const { name = "?", ...rest } = user;
const [first, ...others] = list;Spread vs rest — what's the difference?
Same ... syntax: spread expands an iterable into elements (copying/merging); rest collects remaining items into an array (function params, destructuring). Position tells you which.
How do arrow functions differ from regular functions?
Arrows have no own this (they capture it lexically), no arguments object, can't be used with new, and have no prototype — perfect for callbacks, wrong as object methods.
Optional chaining and nullish coalescing?
?. safely reads deep paths, short-circuiting to undefined instead of throwing. ?? falls back only for null/undefined (unlike ||, which also triggers on 0 and '').
Named vs default exports?
Named exports export multiple values by name (import { a, b }); a default export is the module's single primary value (import anything). Modules run once, in strict mode.
Master modern JavaScript
Destructuring, spread/rest, modules, generators and every ES6+ feature — with interview context in the JavaScript Interview Kit.
⚡ Get the JavaScript Interview Kit → ₹299Frequently asked questions
- What are the most important ES6 features for interviews?
- let/const, arrow functions, destructuring, spread/rest, template literals, promises, modules, and Map/Set.
- Is ES6 still relevant?
- Yes — 'ES6+' is just modern JavaScript. Every current codebase assumes you know these features.
