Let's start with some patterns that reflect JavaScript's unique features. Some patterns aim to help you organize your code, for example, namespacing; others are related to improving performance, such as lazy definitions and init-time branching; and some make up for missing features, such as private properties. The patterns discussed in this section include the following topics:
Separating behavior
Namespaces
Init-time branching
Lazy definition
Configuration objects
Private variables and methods
Privileged methods
Private functions as public methods
Immediate functions
Chaining
JSON
As discussed previously, the three building blocks of a web page are as follows:
Content (HTML)
Presentation (CSS)
Behavior (JavaScript)