AiredFree learning since 2009

JavaScript Interview Flashcards: Core Concepts

Run through these cards the night before your interview. Each answer fits in one breath.

6 flashcards

  1. 1
    What is a closure?
    AnswerA function bundled with references to its surrounding scope, so it can use outer variables after the outer function returns.
  2. 2
    What is hoisting?
    AnswerDeclarations are moved to the top of their scope during compilation. var is initialised to undefined; let/const stay in the temporal dead zone.
  3. 3
    Difference between == and ===?
    Answer== compares after type coercion; === compares value and type without coercion.
  4. 4
    What is the event loop?
    AnswerIt takes callbacks from the task and microtask queues and runs them when the call stack is empty.
  5. 5
    What does Promise.all do?
    AnswerResolves when all promises resolve, or rejects as soon as one rejects.
  6. 6
    What is debouncing?
    AnswerDelaying a function until a set time has passed since the last call — useful for search inputs.