What you'll be able to do
- Run JavaScript in the browser console, in Node and in a web page
- Store values in variables, and keep money exact by working in cents
- Make decisions with if, else and switch, and repeat work with loops
- Write functions with parameters, return values and callbacks
- Organize data with arrays and objects, and read and write JSON
- Transform and total lists with map, filter, find and reduce
- Read error messages, debug with breakpoints and split code into modules
JavaScript Basics in 50 Pages takes you from never having written code to a tested program that runs both in Node and in a web page. Every idea is explained in plain language before it is used, every example was run in Node 22 and Chromium, and every exercise has a hint right under it.
The examples all come from one small coffee company building its own online shop: prices, carts, shipping rules and receipts. The book ends with an order-total calculator, checked against hand-worked answers, that prices orders from the command line and updates a web page as the customer types.
What's in this Kindle edition:
- 13 chapters, each one short enough to finish in a sitting
- Every diagram from the book
- Every code example, run and tested
- A quick reference and glossary at the back
Free with a FiftyPage account (see the last page of the book):
- The PDF edition and a printable cheat sheet
- 229 quiz questions, with a hint and an explanation for every answer
- A final test and a hands-on project, graded automatically
- 191 flashcards, 38 worked examples and 112 code files
- A glossary of 147 terms and spaced-repetition practice
- A certificate when you pass the final test and the project