Eloquent JavaScript, 4th Edition placeholder cover

Eloquent JavaScript, 4th Edition

A Modern Introduction to Programming
by Marijn Haverbeke
Fall 2024, 459 pp
Use coupon code PREORDER to get 25% off!

JavaScript lies at the heart of almost every modern web application, from social media apps to browser-based games. Though simple for beginners to pick up, JavaScript is a flexible, complex language for building full-scale applications.

This much-anticipated fourth edition of Eloquent JavaScript shows you how to write beautiful, effective JavaScript code. It has been updated to reflect the current state of JavaScript and web browsers, discussing new features like optional chaining, nullish coalescing, class properties, private fields, and newly standardized methods. Chapters on asynchronous programming, objects, and modules have been overhauled to reflect modern JavaScript style and improve readability.

Haverbeke teaches through extensive examples and immerses you in code from the start. Exercises and full-chapter projects give you hands-on experience with writing your own programs. You’ll start by learning the basic structure of the JavaScript language as well as control structures, functions, and data structures to help you write basic programs. You’ll then learn about error handling and bug fixing, and modularity before moving on to programming web browsers. As you build projects like a simple programming language and a paint program, you’ll learn to:

  • Understand the essential elements of programming, including syntax, control, and data
  • Organize and clarify your code with object-oriented and functional programming techniques
  • Script the browser and make basic web applications
  • Use the DOM effectively to interact with browsers
  • Harness Node.js to build servers and utilities

Isn’t it time you became fluent in the language of the Web?

Author Bio 

Marijn Haverbeke is a programmer and author. He wrote and maintains a number of open source projects around developer tooling and editing, and contributed to the initial design and implementation of the Rust compiler. He lives in Berlin, running a small, independent software shop.

Table of contents 


Chapter 1: Values, Types, and Operators
Chapter 2: Program Structure
Chapter 3: Functions
Chapter 4: Data Structures: Objects and Arrays
Chapter 5: Higher-Order Functions
Chapter 6: The Secret Life of Objects
Chapter 7: Project: A Robot
Chapter 8: Bugs and Errors.
Chapter 9: Regular Expressions
Chapter 10: Modules
Chapter 11: Asynchronous Programming
Chapter 12: Project: A Programming Language

Chapter 13: JavaScript and the Browser
Chapter 14: The Document Object Model
Chapter 15: Handling Events
Chapter 16: Project: A Platform Game
Chapter 17: Drawing on Canvas
Chapter 18: HTTP and Forms
Chapter 19: Project: A Pixel Art Editor

Chapter 20: Node.js
Chapter 21: Project: Skill-Sharing Website
Chapter 22: JavaScript and Performance

Exercise Hints

The chapters in red are included in this Early Access PDF.


Reviews from the 3rd edition:

“A worthy and much-needed update to the popular programming book. The fact that the book covers ES6 is worth a re-read, but the new edition goes above and beyond with new illustrations, a new exercise, and tighter writing. The 3rd edition of the book is substantially improved from its predecessors and worthy of the hype.”
—Books on Code

"It’s a smart, lean JavaScript tutorial that exists as an in-print book from No Starch Press, and a free, nicely formatted web version . . . easily the most enjoyable read in this list. And there are so many useful insights that you won’t be bored."
—Matthew MacDonald, Medium's Young Coder

“This is all the JavaScript knowledge you’ll need to hit the ground running in a JavaScript project . . . it’s a book I will be frequently revisiting as it has put JavaScript back on my radar.”

“This book would make a great addition to any developer's reference books . . . I really like the author's style of writing and clarity of explanations. The sample code and exercises also work, which can be a rare feature in tech-related books”
—Gary Woodfine, Software Developer

“I think this is one of the most enjoyable programming books I’ve read. It covers the core features of the language concisely but then goes on to illustrate how to use those features.”
—Ian Hopkinson, IanHopkinson.org

“If you’re at all interested in learning JavaScript, making this your first guide could mean the difference between getting discouraged and giving up and really getting into programming as a lifelong venture.”
—Joshua Johnson, Design Shack

“Marijn Haverbeke is a software philosopher and all-round genius. He also has a terrific sense of humor and writes both prose and code in a friendly and un-intimidating fashion. In common with the very best teachers he dispenses his wisdom with disarming simplicity. I became a better architect, author, mentor and developer because of this book. It deserves to share shelf space with Flannagan and Crockford.”
—Angus Croll, Javascript We Blog

"A tour de force that takes you from the fundamentals to the heights of JavaScript mastery. Marijn Haverbeke’s conversational prose breathes life into JavaScript, making it accessible and engaging."
—Alex Maher, .NET C# dev

"The author, Marijn Haverbeke, has a great voice."
—Abu Sayed, Sayed.Cyou Blog

"One of the things that makes [Eloquent JavaScript, 3rd Edition] so good is that it doesn’t shy away from complexity . . . Haverbeke is a talented teacher, and he seems to have an intuitive understanding of how difficult concepts can be explained without oversimplifying them."
—Neil Abad, Book Review Buffs