Chapter 1. Introduction
JavaScript is the language of the Web. It started as a way to manipulate a few selected types of elements in a web page (such as images and form fields), but it has grown tremendously. In addition to client-side browser scripting, these days you can use JavaScript to program for an increasing variety of platforms. You can write server-side code (using .NET or Node.js), desktop applications (that work on all operating systems) and application extensions (e.g., for Firefox or Photoshop), mobile applications, and command-line scripts.
JavaScript is also an unusual language. It doesn’t have classes, and functions are first-class objects used for many tasks. Initially the language was considered deficient by many developers, but in more recent years these sentiments have changed. Interestingly, languages such as Java and PHP started adding features such as closures and anonymous functions, which JavaScript developers have been enjoying and taking for granted for a while.
JavaScript is dynamic enough that you can make it look and feel like another language you’re already comfortable with. But the better approach is to embrace its differences and study its specific patterns.
Patterns
A pattern in the broader sense of the word is a “theme of recurring events or objects…it can be a template or model which can be used to generate things” (http://en.wikipedia.org/wiki/Pattern).
In software development, a pattern is a solution to a common problem. A pattern is not necessarily ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access