Advanced Core
51) What is a closure, and whatâs actually being âclosed overâ?
52) Why are closures useful in real systems?
53) Explain the classic loop + closure problem with var.
var.for (var i = 0; i < 3; i++) {
setTimeout(() => console.log(i), 0); // 3,3,3
}54) How does let fix that closure issue?
let fix that closure issue?55) How can you fix the closure issue without let?
let?56) What is the module pattern and why does it rely on closures?
57) What is garbage collectionâs relationship to closures?
58) Whatâs a practical example of a closure causing a memory leak?
59) What is the prototype chain?
60) How does property lookup work under the hood?
61) Whatâs the difference between __proto__ and prototype?
__proto__ and prototype?62) Why is __proto__ discouraged?
__proto__ discouraged?63) What does new do step-by-step?
new do step-by-step?64) What happens if a constructor returns an object explicitly?
65) What is prototypal inheritance (vs classical)?
66) Whatâs the difference between Object.create(proto) and new C()?
Object.create(proto) and new C()?67) How does instanceof work?
instanceof work?68) When can instanceof fail unexpectedly?
instanceof fail unexpectedly?69) What is this in JavaScript really?
this in JavaScript really?70) What are the main this binding rules?
this binding rules?71) What does strict mode change for this?
this?72) Why do methods lose this when passed as callbacks?
this when passed as callbacks?73) Fix the lost-this issue in callbacks.
this issue in callbacks.74) What is bind, and why is it different from call/apply?
bind, and why is it different from call/apply?75) call vs applyâwhatâs the practical difference?
call vs applyâwhatâs the practical difference?76) Whatâs partial application with bind?
bind?77) Why donât arrow functions have their own this?
this?78) When is arrow function this a bad idea?
this a bad idea?79) What is the event loop in one âhow it worksâ explanation?
80) Whatâs the difference between macrotasks and microtasks?
81) Why do microtasks âwinâ over setTimeout(..., 0)?
setTimeout(..., 0)?82) Predict the output and explain:
83) What is âstarvationâ in the event loop context?
84) How does the browser rendering pipeline relate to the event loop?
85) Why is setTimeout not a precise timer?
setTimeout not a precise timer?86) What is âre-entrancyâ and why does it matter in JS callbacks?
87) What is the call stack and why do we get âMaximum call stack size exceededâ?
88) Whatâs a âstack frameâ in JS?
89) Explain try/catch and async errors: why doesnât try/catch catch promise errors?
try/catch and async errors: why doesnât try/catch catch promise errors?90) Whatâs the difference between throwing and rejecting?
91) What is the arguments object and why is it considered legacy?
arguments object and why is it considered legacy?92) What is âshadowingâ and why can it be a bug source?
93) Whatâs the difference between a âmethodâ and a âfunctionâ in JS?
94) How does .toString()/.valueOf() affect coercion?
.toString()/.valueOf() affect coercion?95) What is Symbol.toPrimitive and why would you implement it?
Symbol.toPrimitive and why would you implement it?96) What does Object.freeze() actually guarantee?
Object.freeze() actually guarantee?97) Why can mutating prototypes be dangerous in production?
98) What is prototype pollution?
99) Whatâs the difference between Map and plain objects for key-value storage?
Map and plain objects for key-value storage?100) Why does this behave differently inside class methods when used as callbacks?
this behave differently inside class methods when used as callbacks?Last updated