JavaScript
From your first console.log to the event loop, data structures and algorithms, the way the videos teach them.
Beginner
Syntax, types, control flow, functions, the built-in collections, errors, files and modules. No experience needed.
-
Lesson 16 min read
JavaScript for beginners: your first program, step by step
See what JavaScript actually is, run it in the browser console and with Node.js, and read a thirteen-line program one line at a time.
-
Lesson 28 min read
JavaScript variables and data types: let, const, typeof, null
The seven kinds of values JavaScript has, how typeof tells them apart, why typeof null says object, and how to convert text to numbers on purpose.
-
Lesson 310 min read
JavaScript numbers and math: 0.1 + 0.2, NaN, rounding, BigInt
Why 0.1 + 0.2 is not quite 0.3 and how to round it, what NaN and Infinity are, the Math toolbox, parseInt for text with units, and BigInt for numbers past nine quadrillion.
-
Lesson 410 min read
JavaScript strings: template literals, slice, split, replaceAll
Build sentences with backticks, why a string never changes in place, indexing and slice, why a thumbs up emoji has length 2, trim, split, includes, replaceAll, padStart, for...of and comparing text. Two short programs with their real output.
-
Lesson 59 min read
JavaScript conditionals: if else, switch, === and ??
How your code makes decisions: why to always use triple equals, which values are truthy and falsy, if, else if and else, switch with break, the ternary, and, or, short circuiting, and the nullish operator for defaults. Two short programs with their real output.
-
Lesson 610 min read
JavaScript loops: for, while, for...of, break and continue
How your code repeats itself: the three parts of every loop, while, do while, for, break and continue, for...of for lists and strings, why for...in is the wrong loop for an array, nested loops and a labeled break. Three short programs with their real output.
-
Lesson 712 min read
JavaScript functions: declaration, arrow, default, rest and return
How you write steps once and reuse them: function declarations, expressions and arrow functions, parameters and arguments, default values, rest parameters, return, scope, hoisting, and why a function is just a value. Three short programs with their real output.
-
Lesson 811 min read
JavaScript arrays: index, push, pop, slice, splice and copy
How you keep many values in one ordered list: creating an array, reading items by index, length, push, pop, shift and unshift, splice and slice, why equals does not copy an array, includes and indexOf, destructuring, and why a const array can still change. Three short programs with their real output.
-
Lesson 98 min read
JavaScript array methods: map, filter, reduce, sort and more
How you work on a whole list at once: forEach, map, filter, reduce, find, findIndex, some and every, the sort comparator gotcha, toSorted and toReversed, and chaining. Three short programs with their real output.
-
Lesson 108 min read
JavaScript objects: keys, methods, spread and more
How you group related values under names: object literals, the dot and brackets, methods and this, destructuring, spread, optional chaining, Object.keys, values and entries, and why a copy is not a second name. Three short programs with their real output.
-
Lesson 118 min read
JavaScript Map and Set: keys, values, unique items and union
How you store key and value pairs in a Map and unique values in a Set: set, get, has, delete, looping in order, Map or object, removing duplicates, union, intersection and difference, and counting words. Three short programs with their real output.
-
Lesson 128 min read
JavaScript error handling: throw, try/catch and custom errors
How you raise an error with throw, recover with try, catch and finally, pick the right built-in error type, write your own error class, keep the original failure with cause, read a stack trace, and check a caught value with ES2026 Error.isError. Three short programs with their real output.
-
Lesson 139 min read
JavaScript files and JSON in Node: read, write and parse
How a program remembers after it ends: pass words in with process.argv, read and write files with readFileSync and writeFileSync, turn objects into text with JSON.stringify and JSON.parse, see what JSON quietly drops, and build a notes tool that saves to a file. Four short programs with their real output.