Eloquent JavaScript
second edition

A modern introduction to JavaScript, programming, and the wonders of the digital.

Cover image

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) 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.

Contents

  1. Introduction
  2. (Part 1: Language)

    Values, Types, and Operators
  3. Program Structure
  4. Functions
  5. Data Structures: Objects and Arrays
  6. Higher-order Functions
  7. The Secret Life of Objects
  8. Project: Electronic Life
  9. Bugs and Error Handling
  10. Regular Expressions
  11. Modules
  12. Project: A Programming Language
  13. (Part 2: Browser)

    JavaScript and the Browser
  14. The Document Object Model
  15. Handling Events
  16. Project: A Platform Game
  17. Drawing on Canvas
  18. HTTP
  19. Forms and Form Fields
  20. Project: A Paint Program

Other pages