Now on Omarchy: read the manual without leaving your desktop
All practice

JavaScript Practice

Hands-on JavaScript lessons - write real functions, run them instantly, and get checked by real tests.

Basic 0/21 complete

JavaScript Practice

Twenty-one short, hands-on JavaScript lessons: start with your first variable, build up through closures and classes, debug a real thrown error from its stack trace, revisit arrays and objects with curried functions, set operations, and a combined search, work through a few classic katas (roman numerals, a Caesar cipher, a smallest-common-multiple calculator), then climb into the code that runs clean and is still wrong. Each lesson gives you a task and a Run button - your code is checked against real tests the moment you run it. Everything runs in your browser.

The last six are the ones that bite at work. A thrown error tells you where to look; these do not get you that. sort() putting 10 before 9 because it compares text, || overwriting a deliberate 0, a spread copy that still shares its nested objects, map(parseInt) returning NaN out of nowhere, a cart total that drifts by a cent, and a capstone where an API sends some amounts as numbers and some as strings, so + glues them together instead of adding them up.

Start with lesson 1. You can leave and come back any time - your code is saved locally.

Lessons

21 total
  1. 01 Variables and expressions
  2. 02 Functions
  3. 03 Conditionals
  4. 04 Arrays: map, filter, and reduce
  5. 05 Objects
  6. 06 Closures
  7. 07 Classes and inheritance
  8. 08 Fix the bug: read the stack trace
  9. 09 Curry and partial application
  10. 10 Array set operations
  11. 11 Object + array combined search
  12. 12 Roman numeral converter
  13. 13 Caesar cipher
  14. 14 Smallest common multiple
  15. 15 Capstone: shopping cart total
  16. 16 Fix the bug: sort() quietly sorts numbers as text
  17. 17 Fix the bug: || quietly eats a real zero
  18. 18 Fix the bug: one user's edit changes everyone
  19. 19 Fix the bug: map(parseInt) quietly returns the wrong numbers
  20. 20 Fix the bug: the checkout refuses a correct total
  21. 21 Capstone: JSON numbers that arrive as strings