JavaScript is the language browsers run, so the browser is the natural place to learn it. Each lesson explains one idea, gives you a task and an editor, and runs your code in an isolated sandbox the moment you press Run. The checks say what they expected and what your code produced; hints and a reference solution are a click away.
The course covers the language itself, the part that is the same whether you later build web pages, servers with Node, or scripts: values, decisions, loops, arrays and objects, strings, functions in depth, and finally promises, async/await, errors, and classes. It ends in a project, a checkout that turns an order into a receipt, that is not started from nothing: lessons along the way build its parts, saved in this browser as you go, and the project loads them before your code. Forty lessons, each about ten minutes.
What you will learn
- let, const, numbers, strings, template literals
- if, else, switch, ternaries, truthiness
- for, while, for...of loops
- Arrays with map, filter, reduce, sort
- Objects, destructuring, spread, JSON, Map, Set
- String methods, dates, regular expressions
- Arrow functions, closures, recursion
- Promises, async/await, try/catch, classes
- A final project assembled from the parts you built
The final project
The course ends with Project: checkout: a checkout that turns an order into a receipt, assembled from your own functions. 11 of the lessons build a part of it, saved in this browser as you go, so the project is assembled from your own work rather than started from nothing.
TAX_RATE(let and const) is the sales tax rate the receipt applies.shippingCost(Functions) decides the shipping line of the receipt: free from 50 dollars, 5.99 below.pad(while loops) lines up the receipt columns by padding each label to a fixed width.sum(reduce, find, some, every) adds up a list of numbers; the receipt total is a sum.cartTotal(Arrays of objects) adds up price times quantity over the items in an order.money(Parsing and formatting numbers) formats every amount on the receipt as US dollars.addDays(Dates) works out the delivery date from the order date.makeDiscount(Closures) builds the function that applies an order's coupon rate.fetchStock(Promises) looks up how many of a product are in stock, asynchronously, like a server call.validateOrder(Errors: throw, try, catch) refuses an order with no items or a bad quantity before any money is worked out.Receipt(Classes) collects the labeled amounts of an order and totals them.