Modern ES6+ & Async
101) What problem did ES6 Modules solve compared to old scripts?
102) import vs require() â whatâs the real difference?
import vs require() â whatâs the real difference?103) Why canât you import inside an if in normal ESM syntax?
import inside an if in normal ESM syntax?if (flag) {
const mod = await import("./heavy.js");
}104) Whatâs the difference between default export and named export ?
105) What is âtree-shakingâ in simple terms?
106) What is destructuring and why do interviewers like it?
107) Destructuring: whatâs the âgotchaâ with missing properties?
108) How do destructuring defaults differ from || defaults?
|| defaults?109) What is the spread operator ... really doing in arrays?
... really doing in arrays?110) Spread on objects: whatâs the important detail?
111) Rest parameters (...args) vs arguments â why is rest better?
(...args) vs arguments â why is rest better?112) What are template literals beyond âstring interpolationâ?
113) What is a Promise in one line?
114) Why do Promises feel different from callbacks?
115) What are the 3 states of a Promise and why does it matter?
116) Whatâs the difference between .then() and .catch()?
.then() and .catch()?117) Why does a .then() return a new Promise?
.then() return a new Promise?118) What happens if you return a Promise inside .then()?
.then()?119) What happens if you throw inside .then()?
.then()?120) Whatâs finally() for?
finally() for?121) Promise microtask â why do promises run âbefore timeoutsâ?
122) async/await is âsyntactic sugarâ⌠but for what exactly?
async/await is âsyntactic sugarâ⌠but for what exactly?123) What does an async function always return?
async function always return?124) Why does this work with try/catch?
125) Whatâs a common mistake with await inside loops?
await inside loops?126) Promise.all â whatâs the behavior interviewers test?
Promise.all â whatâs the behavior interviewers test?127) Promise.allSettled â when do you prefer it?
Promise.allSettled â when do you prefer it?128) Promise.race vs Promise.any â whatâs the difference?
Promise.race vs Promise.any â whatâs the difference?129) How would you implement a timeout for a promise?
130) What is optional chaining ?. doing under the hood?
?. doing under the hood?131) What is the nullish coalescing operator ?? good for?
?? good for?132) Whatâs the difference between || and ?? in practice?
|| and ?? in practice?133) What are iterators in simple terms?
134) What are iterables?
135) Why does for...of work on arrays but not plain objects?
for...of work on arrays but not plain objects?136) How does a generator function work conceptually?
137) What does yield actually do?
yield actually do?138) Whatâs the difference between yield and return inside generators?
yield and return inside generators?139) Why are generators useful in real apps?
140) Explain for await...of in one âwhy it existsâ sentence.
for await...of in one âwhy it existsâ sentence.141) Whatâs the âgotchaâ with Array.prototype.forEach and await?
Array.prototype.forEach and await?142) What is a âthenableâ and why does it matter?
143) What are dynamic imports good for in performance?
144) Whatâs top-level await and when should you avoid it?
145) What is Symbol used for in day-to-day engineering?
Symbol used for in day-to-day engineering?146) Whatâs the difference between Map and Set (ES6 structures)?
Map and Set (ES6 structures)?147) Why is Map often preferred over {} for dictionaries?
Map often preferred over {} for dictionaries?148) Whatâs the difference between shallow and deep copy in ES6+ tools?
149) What is the structured clone idea (conceptually)?
150) If async/await is so nice, why should you still understand Promises?
async/await is so nice, why should you still understand Promises?Last updated