I was excited to have this book in my hands. I had high expectations for a book whose target audience is professional JavaScript developers. Honestly, all of my expectations have been satisfied. This is not just another introduction to the modern JavaScript language, nor is it a book of JavaScript recipes for solving specific daily problems that JavaScript developers encounter. It presents JavaScript programming methodologies to build reusable code, with a high degree of browser interoperability with a good reference to the document object model (DOM) and to the standard ECMAScript 5, introducing browser-specific implementations and problems.
Nowadays, JavaScript is gaining popularity by a factor of 30 percent per year, being ranked in the top ten programming languages [1,2,3,4]. Many native JavaScript frameworks have been published and are actively supported by a very large community (both in question-and-answer (Q&A) sites such as Stackoverflow and in commits in code repositories such as GitHub). Frameworks such as Node.js enrich the JavaScript functionalities to build fully featured WebApps from scratch. AngularJS provides a model-view-controller (MVC) approach when developing web interfaces, and tools like Google Web Toolkit (GWT) and Vaadin enable Java developers to use JavaScript natively. In addition, seeing such enthusiasm in the JavaScript community shows that JavaScript itself is an evolving language. Although the ECMA technical committee is working toward a consolidation of the language, the legacy still exists. Legacy browsers and developers used to work with JavaScript during the “browser wars,” resulting in source code that is hard to maintain and to evolve.
The book aims to provide professional JavaScript developers with hints and techniques to create reusable code that works, guided by tests (for example, introducing test-driven development (TDD) techniques to JavaScript developers). In order to fully appreciate the book, the reader should be familiar with the discussed technology, including JavaScript, the hypertext transfer protocol (HTTP), and the Hypertext Markup Language (HTML)/cascading style sheets (CSS) pair. The book commences with a history and background, the browser wars era, and what happened to the language over the years. Next, a high-level description of language features to create reusable code (here, readers need language knowledge and project experience to better understand the content) is provided. In particular, object-oriented JavaScript, modules, and closures are tackled. Chapter 4 is all about debugging. Next, the book provides insight into DOM (further described in the appendix), for example, how to get and set Extensible Markup Language (XML) elements. Next, the book describes events and how to deal with them in all modern browsers. Chapter 7 describes the form validation application program interface (API), its limitations, and how to overcome them with custom validators. Following is an introduction to Ajax without referencing specific frameworks. Chapter 9 is extremely useful; it surveys web production tools (like NPM, GIT, Yeoman, and Bower). Next comes and introduction to AnuglarJS and TDD in JavaScript. The book concludes with a discussion of the future of JavaScript, and in particular ECMAScript 6.