TetSharing

JavaScript tutorial

The language of the web browser, and of a lot of servers too. 19 short chapters, one idea each, every example runnable in the page.

Who it's for: Beginners who want to make web pages interactive, and developers coming from another language who need the modern syntax fast.

Prerequisites: Basic HTML helps for the DOM lesson, but the language chapters need nothing beyond a browser.

Start with chapter 1 →

Lines of syntax-highlighted code glowing on a screen in a dark room
Photo: afgprogrammer on Unsplash

How this JavaScript track is organized

Chapters 1 to 9 cover the language core: running code, let and const, types, operators, strings, template literals, conditions, loops and functions. Chapters 10 to 15 cover arrow functions, arrays and their methods, objects, destructuring and classes. The last chapters deal with errors, promises, async/await and JSON, which you need as soon as code talks to a server.

The track teaches the language itself, as defined by the ECMAScript specification, so everything applies in browsers and in Node.js. Every example runs in a sandboxed frame in your browser and is also executed with Node.js by our test suite.

One detail about output: the runner prints arrays and objects in a compact form such as ["a", "b"] and {x: 1}. Browser developer tools and Node.js show the same values with slightly different spacing and quotes.

All 19 chapters

  1. 01Get started
  2. 02let, const and var
  3. 03Data types
  4. 04Operators and equality
  5. 05Strings
  6. 06Template literals
  7. 07if, else and switch
  8. 08Loops
  9. 09Functions
  10. 10Arrow functions
  11. 11Arrays
  12. 12map, filter, reduce
  13. 13Objects
  14. 14Destructuring and spread
  15. 15Classes
  16. 16Errors and try...catch
  17. 17Promises
  18. 18async and await
  19. 19JSON

Practice and reference

Final JavaScript quiz (19 questions)Cheat sheet: javascript array methodsOfficial JavaScript documentation