browse/
6 results
computers/the-call-stack-why-a-function-that-never-stops-crashes-your-program.md
The call stack: why a function that never stops crashes your program
Every time a function is called, the computer puts a small block of memory called a frame on top of a call stack, and removes it when the…
languages/javascript-s-event-loop-why-settimeout-0-runs-after-the-code-below-it.md
JavaScript's event loop: why setTimeout(…, 0) runs after the code below it
Why does `setTimeout(fn, 0)` run after the lines below it, and why does a promise callback beat it? JavaScript has one worker and two…
computer-science/stacks-and-queues-why-undo-takes-the-newest-item-and-a-printer-takes-t.md
Stacks and queues: why undo takes the newest item and a printer takes the oldest
Press undo and the last thing you typed disappears first. Send documents to a shared printer and the first one is printed first. Both are…
computer-science/breadth-first-search-how-a-maze-solver-finds-the-shortest-way-out.md
Breadth-first search: how a maze solver finds the shortest way out
How does a maze solver, or a map app, find the shortest route and not just any route? The answer is breadth-first search: explore every…
computer-science/recursion-why-fib-30-makes-2-7-million-calls-and-how-a-notebook-fixes.md
Recursion: why fib(30) makes 2.7 million calls, and how a notebook fixes it
A function that calls itself sounds like an endless loop, but it works when every call gets a smaller problem and one case is simple enough…
computers/the-call-stack-how-your-computer-remembers-where-to-come-back-to.md
The call stack: how your computer remembers where to come back to
When one function calls another, how does the computer remember where to come back to? It keeps a pile of frames called the call stack…