Learn modern JavaScript by writing console programs that run on Node.js 24, from printing and variables to closures, classes and a small final project.
15 lessons, 30 exercises. Runs JavaScript Node.js 24.
Not started
Hello, output
Print text with console.log, write comments, and see how Node.js runs a file from top to bottom.
Values and variables
Store values in variables with const and let, meet JavaScript's basic types, and build text with template literals.
Reading input and arithmetic
Read all of standard input with Node's fs module, turn text into numbers, and calculate with JavaScript's operators.
Making decisions
Choose what your program does with if, else and switch, using comparison and logical operators.
Loops
Repeat work with for, while and for...of loops, and leave a loop early with break and continue.
Functions
Package code into reusable functions with parameters and return values, and learn where variables are visible.
Collections
Keep many values together in arrays, and look values up by key with objects and Map.
Strings and a small project
Slice, search, change and pad strings, then combine everything so far into a receipt printer.
Handling errors
Throw and catch exceptions with try, catch and finally, use the built-in error types, and decide where errors should be handled.
Structuring data
Model real things with object literals and classes, including constructors, methods, getters, private fields and static members.
Recursion
Solve problems by having a function call itself on a smaller piece, with a base case that stops it.
Sorting and searching
Sort arrays correctly with compare functions, order by several keys, and find values quickly with find and binary search.
Maps and sets in depth
Count and group data with Map and Object.groupBy, and compare collections with Set operations like union and intersection.
Closures and higher-order functions
Treat functions as values, transform data with map, filter and reduce, and use closures to build functions that remember state.
Final project
Combine classes, maps, errors, recursion and higher-order functions into two larger programs, a shop inventory and a tiny calculator.
Your progress is saved in this browser. Sign in to keep it on every device.