Chapter 2. Reintroducing JavaScript

This chapter covers
  • Variable scoping, function hoisting, and the execution context object
  • Explaining variable scope chains and why we use them
  • Creating JavaScript objects using prototypes
  • Writing self-executing anonymous functions
  • Using the module pattern and private variables
  • Exploiting closures for fun and profit

This chapter reviews unique JavaScript concepts that we need to know if we’re to build a native JavaScript single page application of significant scale. The snippet of code in listing 2.1 from chapter 1 shows the concepts we’ll be covering. If you understand all of these how and why concepts then you might skim or skip this chapter and get straight to work on an SPA in ...

Get Single Page Web Applications now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.