Eloquent JavaScript
Eloquent JavaScriptsecond edition
This is a book about JavaScript, programming, and the wonders of the digital. You can read it online here, or get your own paperback copy of the book.
Written by Marijn Haverbeke.
Licensed under a Creative Commons attribution-noncommercial license. All code in this book may also be considered licensed under an MIT license.
Illustrations by various artists: Cover by Wasif Hyder. Computer (introduction) and unicycle people (Chapter 21) by Max Xiantu. Sea of bits (Chapter 1) and weresquirrel (Chapter 4) by Margarita MartÃnez and José Menor. Octopuses (Chapter 2 and 4) by Jim Tierney. Object with on/off switch (Chapter 6) by Dyle MacGregor. Regular expression diagrams in Chapter 9 generated with regexper.com by Jeff Avallone. Game concept for Chapter 15 by Thomas Palef. Pixel art in Chapter 16 by Antonio Perdomo Pastor.
The second edition was made possible
by 454 financial backers, with
significant contributions from
,
, and
.
Contents
- Introduction
- 2
(Part 1: Language)
Values, Types, and Operators - 3Program Structure
- 4Functions
- 5Data Structures: Objects and Arrays
- 6Higher-order Functions
- 7The Secret Life of Objects
- 8Project: Electronic Life
- 9Bugs and Error Handling
- 10Regular Expressions
- 11Modules
- 12Project: A Programming Language
- 13
(Part 2: Browser)
JavaScript and the Browser - 14The Document Object Model
- 15Handling Events
- 16Project: A Platform Game
- 17Drawing on Canvas
- 18HTTP
- 19Forms and Form Fields
- 20Project: A Paint Program
- 21
(Part 3: Node)
Node.js - 22Project: Skill-Sharing Website
Other pages
A paper version of Eloquent JavaScript, including a bonus chapter, is being brought out by No Starch Press. They also sell an ebook version more polished than the files linked below.
