JavaScript, Up Close
The runtime behaviours that catch everybody out — ordering, coercion, identity — each one predicted by you first, then run for real.
- Predict the Output Order: the Event Loop Rule Is One SentenceEveryone has seen the diagram with the queues and the arrows, and still cannot say what a six-line program prints. Order the output yourself here, then watch the same three programs run for real and see which queue each line came from.✓ numbers produced by the code on this page
- Your Object Is Not a Hash Map: Seven Expressions Most People Get WrongUse a Map instead of an object is advice everyone has heard and nobody follows, because the reasons are read as a list of properties. Predict what seven expressions evaluate to here, and the reasons stop being a list.✓ numbers produced by the code on this page