psst… explained, not just answered

Developer interview questions & practice.

Prepare with explained interview questions and study notes for JavaScript, TypeScript, React, Angular, Node.js, Java, Spring Boot and SQL, organized by topic and with the reasoning written in the margins. Finally, practice them like it's the real interview.

Closures, Ch. 1 ✦
function outer() {
  let count = 0;
  return function inner() {
    return ++count;
  };
}
const next = outer();
next(); // 1
next(); // 2 ← why not 1?!
Q: var vs let?var → function scope, hoisted as undefined
let → block scope + TDZ!
Try it yourself ★Explain why the closure remembers count.

Pick a chapter (start anywhere, really)

See all chapters →

The practice room no sign-up, saved in your browser

Open the practice room →

Good places to start picked by hand ✎

All notes →

Tear-off cheat sheets print & stick on your wall

All cheat sheets →
esc