`==` compares values after type coercion, so `0 == "0"` is true. `===` (strict equality) compares both value and type without coercion, so `0 === "0"` is false. Prefer `===` to avoid surprising coercion bugs.
JavaScript· asked at Generic✓ Added to review
`undefined` means a variable was declared but not assigned; `null` is an explicit 'no value' you assign intentionally. `typeof undefined` is 'undefined', `typeof null` is 'object' (a historical quirk).
JavaScript· asked at Generic✓ Added to review
Event delegation attaches a single listener to a common ancestor instead of many listeners on individual children. Events bubble up, and you inspect `event.target` to act on the originating element. It reduces memory use and works for dynamically-added elements.
JavaScript· asked at Meta✓ Added to review
A closure is a function bundled with references to its surrounding lexical scope, retaining access to those variables after the outer function returns. Practical uses: data privacy (module pattern), function factories, and maintaining state in callbacks.
JavaScript· asked at Google✓ Added to review
JS runs on a single thread with a call stack. Async callbacks go to task queues (macrotasks like setTimeout, microtasks like Promises). The event loop pushes queued callbacks onto the stack only when it is empty, draining all microtasks before the next macrotask.
JavaScript· asked at Amazon✓ Added to review
💬
Send Feedback / Bug
Feedback Submitted!
Thank you. Your help keeps Geeky Script running smoothly.