Sefism is free for learners. We are here to help you grow, one step at a time.Join for free
Sefism.
Book · Web DevelopmentFree

Eloquent JavaScript

Eloquent JavaScript by Marijn Haverbeke is a book that teaches programming through JavaScript, now in its fourth edition (2024). It covers the language, the browser and Node.js, with four project chapters and exercises you can run in the page. It is free to read online, with a paper edition from No Starch Press. It suits people who can already write some code and want to think and write like a programmer, not just learn syntax.

Edition

4th edition (2024)

eloquentjavascript.net · Sept 2026

Chapters

22 in three parts

eloquentjavascript.net · Sept 2026

Goodreads rating

4.15/5 (2,435 ratings, 1st ed.)

Goodreads · Sept 2026

GitHub stars

3.1k (marijnh/Eloquent-JavaScript)

GitHub · Sept 2026

Format

Book

Topic

Web Development

Provider

Marijn Haverbeke

Time needed

6 to 10 weeks

Level

Intermediate

Access

Free

What the book covers

The fourth edition has 22 chapters in three parts:

  • The language (12 chapters): values and types, program structure, functions, data structures, higher-order functions, objects, bugs and errors, regular expressions, modules and asynchronous programming.
  • The browser (5 chapters): the DOM, events, and drawing on canvas.
  • Node.js (2 chapters): running JavaScript outside the browser, including a small HTTP server.

Four project chapters apply what came before: a robot simulation, a small programming language with its own interpreter, a platform game, and a pixel art editor. Every chapter ends with exercises, and a code sandbox on the site lets you run examples and check solutions without installing anything.

The online edition is free under a Creative Commons attribution-noncommercial licence, with the code under MIT. It is also available as PDF, EPUB and MOBI, and No Starch Press publishes a paper edition that includes an extra chapter.

What sets it apart

It is about programming, not about syntax. The chapters on higher-order functions, abstraction and program structure teach ways of thinking that transfer to every language you use afterwards. The language project, where you build an interpreter in a few hundred lines, is something most introductory books would never attempt, and it permanently changes how you think about code.

Fair warning about difficulty

The prose is friendly, but the exercises are much harder than the text suggests and the pace is brisk. Many readers breeze through the first chapters and hit a wall around higher-order functions or the robot project. That difficulty is where the value is, but it makes this a poor first ever programming book for most people.

What readers say

On Goodreads the first edition alone has about 2,400 ratings averaging 4.15 out of 5, and later editions also rate well (checked September 2026). Readers regularly praise the writing and the depth of the projects. The most common complaint is exactly the difficulty jump: several reviewers say it is better as a second book than a first. The source is maintained on GitHub (marijnh/Eloquent-JavaScript, about 3.1k stars, commits in 2026).

How to work through it

  • Attempt every exercise before opening the hints. Getting stuck for twenty minutes is normal.
  • Do the project chapters slowly, typing the code and changing it. Skipping them misses half the book.
  • If a chapter overwhelms you, read the matching javascript.info chapter for a gentler explanation, then come back.
  • Expect six to ten weeks at a few hours a week. Speed is not the goal.

Common questions

Is it free? Yes, the full current edition is free online. The paper book is optional.

Is it good for complete beginners? Motivated beginners can manage it, but most people do better starting with a gentler course and coming here once they can write small programs.

Is the 4th edition much different? It modernises the code (classes, modules, async functions) and replaces older material. If you are starting now, read the 4th edition.

Best for: developers who can already write some code and want to write better code.

javascriptcomputer sciencefree course

Ready to start?

Opens on Marijn Haverbeke in a new tab.

Open resource
Link broken or out of date?

Report a problem

With "Eloquent JavaScript". Only Tauseef reads this.

Work with me

Stuck on something specific?

Writing only gets you so far. If you want an answer to your situation rather than the general case, book a session and we will work through it together. Sessions are free for approved Sefism members, and a few slots open each week.