Skip to content

Eloquent JavaScript

Dušan Dimitrić edited this page Sep 10, 2016 · 9 revisions

Eloquent JavaScript

Eloquent JavaScript Book

This is a simply brilliant (and truly eloquent) programming book. Every JS developer should read this book and go through the examples and exercises as thoroughly as possible (it can get though). It's aimed more towards intermediate JS programmers but offers valuable insight to even the people that have been using the language for a longer while.

What I like about it the most is that it goes 'behind the curtain' and reveals how JS really works.

Notes:

I didn't take notes immediately when I've started to read the book so the first 13 chapters are missing but I'll surely re-read this book and add notes for those chapters too.

Chapter 14 - Handling Events

  • page 253 - A DOM node has only one onclick attribute, so you can register only one handler per node that way. The addEventListener method allows you to add any number of handlers, so you can't accidentaly replace a handler that has already been registered.

  • page 258 - keypress =/= keydown, keypress fires right after keydown (and is repeated along with keydown when the key is held) but only for keys that produce character input.

  • page 260 - Mouse dragging implementation example

  • page 260 - Mouse dragging example, mousedown event.preventDefault() prevents selection from happening

  • page 262 - Mouse hover intricacies

  • page 266 - Web Workers

  • page 268 - Debouncing - useful for "live search" AJAX implementation and mouse tracking (heatmapping)

15 Project: A Platform Game

Not a lot of super useful stuff here, it's better to refer to a book specifically written about game programming if you're interested in the topic.

Chapter 16 - Drawing on Canvas

An overview of the canvas API. Not particularly interesting but there are a neat couple of small examples like: pie chart, fractal tree etc.

Chapter 17 - HTTP

This chapter starts off with a short overview of the HTTP protocol and leads to HTTP and JavaScript.

  • page 328 - XMLHttpRequest - it's history, usage (synchronous, asynchronous), security issues, abstracting it etc. From here we're slowly moving into "Node-like" async patterns.
  • page 335 - Promises
  • page 336 - Example of fetching multiple JSON files using promises
  • page 338 - REST and HTTPS introductions.

The last exercise in this chapter shows a (bit involved, 'homemade') solution to callback hell problem with promises.

Chapter 18 - Forms and Form Fields

  • page 349 - Radio button event listeners pattern

  • page 349 - Select Fields

  • page 351 - File Input Fields

  • page 353 - Local Storage | Session Storage

  • page 357 - Autocompletion

19 Project - A Paint Program

  • page 374 - Fill tool.. working with image pixel data.. interesting...

Chapter 20 - Node.js

A solid introduction to Node.js.

21 Project - Skill-Sharing Website

This project is maybe a little too convoluted but it's still worth going through.