predict
Say what it does, before it does it
A program, unrun, and the questions it chose. Answer them, and then the machine runs it and shows you exactly where you and it disagreed. Nothing here asks you to write code.
- Objects, references and mutation · warm-upTwo names, and a push through one of them.
- Objects, references and mutation · routineA spread, and a change to something inside it.
- Objects, references and mutation · routineA sort, and the array it was called on.
- Hoisting, scope and the dead zone · warm-upTwo declarations, read before their own lines.
- Hoisting, scope and the dead zone · routineA read above a
let. - Closures · warm-upA function made before the value changed.
- Closures · routineTwo counters from one factory.
- `this` and prototypes · routineA method, pulled off its object.
- `this` and prototypes · hardTwo objects sharing a prototype, and a write to one of them.
- Control and failure · hardA
returnin atry, and another in thefinally. - Control and failure · routineA throw, three frames deep.
- Control and failure · routineA
switchwith one missingbreak. - Reading what was generated · hardA model wrote this helper. Say what it returns and what it changed on the way, before you run it.
- The event loop · routineA model wrote this to read a total. Say what
totalholds when the last line runs. - The event loop · routineFour lines that log, and two queues.
- Objects, references and mutation · hardWrite
withTag, which returns a list with the tag added. First say what the reference does to its argument.