Key points
- Both books are free to read in full online: Eloquent JavaScript on its own site, You Don't Know JS Yet in its GitHub repository. (Source: https://eloquentjavascript.net/; https://github.com/getify/You-Dont-Know-JS/tree/2nd-ed)
- Eloquent JavaScript lists 21 chapters plus an introduction, five of them projects, spanning the language, the browser and Node.js. (Source: https://eloquentjavascript.net/)
- You Don't Know JS Yet is a series on core language mechanisms; its README gives purchase links for two books, labels two as drafts and strikes two as canceled. (Source: https://github.com/getify/You-Dont-Know-JS/tree/2nd-ed)
Both are free, so the question is order
Nothing here needs buying to start. The Eloquent JavaScript home page says "You can read it online here" and labels the current text the 4th edition (2024). The You Don't Know JS Yet README says "you'll be able to read these books online here entirely for free." We checked both pages on 2026-11-20.
Our answer: open Eloquent JavaScript first if you want to build things and meet the browser and Node.js early; open You Don't Know JS Yet first, or second, if you already write JavaScript and want the language's inner workings explained. The two do not compete for the same job, and the rest of this page is the evidence.
If you are choosing between editions of either book rather than between the two books, we compared those separately: Eloquent JavaScript, 3rd or 4th edition and You Don't Know JS, first or second edition.
What we counted on each book's own pages
We fetched the Eloquent JavaScript contents page and the GitHub file tree of the You Don't Know JS Yet branch (2nd-ed) on 2026-11-20. The repository's most recent commit on that branch was dated 2026-10-31.
| Eloquent JavaScript (4th ed.) | You Don't Know JS Yet (2nd ed.) | |
|---|---|---|
| Where the full text lives | eloquentjavascript.net | GitHub repository, branch 2nd-ed |
| Contents pages counted | 22 (an introduction plus 21 chapters) | 6 book folders, 23 chapter files |
| Project chapters | 5 | not counted |
| Structure on the page | Part 1: Language (12 chapters), Part 2: Browser (7), Part 3: Node (2) | Get Started, Scope & Closures, Objects & Classes, Types & Grammar, Sync & Async, ES.Next & Beyond |
| Status stated by the author | 4th edition (2024) | two books with purchase links, two drafts, two canceled |
The YDKJ numbers need one caveat, and it changes how you should read the table. Its README strikes through "Sync & Async" and "ES.Next & Beyond" as canceled, yet each folder holds one chapter file. Of the 23 chapter files, 21 belong to the four books that were not canceled: Get Started (4), Scope & Closures (8), Objects & Classes (5) and Types & Grammar (4). The README labels Objects & Classes "draft stable" and Types & Grammar "rough draft".
To repeat the counts:
curl -sL https://eloquentjavascript.net/ | grep -oE 'href="[0-9]{2}_[a-z_]+\.html"' | sort -u | wc -l
curl -sL https://eloquentjavascript.net/ | grep -oE 'href="[0-9]{2}_[a-z_]+\.html">Project: [^<]*' | sort -u | wc -l
curl -sL 'https://api.github.com/repos/getify/You-Dont-Know-JS/git/trees/2nd-ed?recursive=1' | python3 -c "import sys,json,re,collections;t=json.load(sys.stdin)['tree'];c=collections.Counter(x['path'].split('/')[0] for x in t if re.fullmatch(r'[a-z-]+/ch\d+\.md',x['path']));print(sorted(c.items()),sum(c.values()))"
These printed 22, 5 and [('es-next-beyond', 1), ('get-started', 4), ('objects-classes', 5), ('scope-closures', 8), ('sync-async', 1), ('types-grammar', 4)] 23 when we ran them. The GitHub tree is a public API with a low anonymous request limit, so a repeat run can be refused.
Which one first
Start with Eloquent JavaScript if you want a single path from the language into a browser page and a Node.js program. Its contents interleave chapters with projects (a robot, a programming language, a platform game, a pixel art editor, a skill-sharing website), and the page places the browser and Node chapters after the language chapters. The author licenses the text under a Creative Commons attribution-noncommercial license, which the home page states.
Start with You Don't Know JS Yet if you can already write JavaScript and want the mechanisms behind it. Its README describes the series as "diving deep into the core mechanisms of the JavaScript language" and recommends reading Get Started, then Scope & Closures, before the rest. Because only the first two books carry purchase links and the other two are labeled drafts, plan on those first two as the stable core.
How you like to read matters too. Eloquent JavaScript's page links a code sandbox and exercise solutions, and offers the whole book as a single PDF file, an EPUB file and a MOBI (Kindle) file. The You Don't Know JS Yet README presents its books as folders in the repository, and the README we fetched names no downloadable file formats. If you prefer to work through exercises in a browser and keep an offline copy, Eloquent JavaScript's page documents that route; for YDKJ the page documents reading online.
If you are new to programming, nothing on either page says which of the two is easier to begin with. We would not read YDKJ's mechanism-focused series before writing any code, but that is a judgment from the page descriptions, not something we tested.
What these pages do not tell you
We have not read either book end to end, so we cannot say which explains closures or the event loop more clearly, how long either takes, or how hard the exercises are. A chapter count is not a length: we did not count words or pages, and the YDKJ chapters and the Eloquent chapters may differ widely in size. Neither page offers a measured comparison of learners using the two books. The YDKJ README says the series is complete and closed to contributions, so the two drafts and the two canceled books are unlikely to change, but the page does not promise that. Whether the draft books are accurate enough to rely on is something we could not check.

Comments