JavaScript Interview Flashcards: Core Concepts
Run through these cards the night before your interview. Each answer fits in one breath.
6 flashcards
- 1What is a closure?AnswerA function bundled with references to its surrounding scope, so it can use outer variables after the outer function returns.
- 2What is hoisting?AnswerDeclarations are moved to the top of their scope during compilation.
varis initialised toundefined;let/conststay in the temporal dead zone. - 3Difference between == and ===?Answer
==compares after type coercion;===compares value and type without coercion. - 4What is the event loop?AnswerIt takes callbacks from the task and microtask queues and runs them when the call stack is empty.
- 5What does Promise.all do?AnswerResolves when all promises resolve, or rejects as soon as one rejects.
- 6What is debouncing?AnswerDelaying a function until a set time has passed since the last call — useful for search inputs.