What this book covers
Chapter 1, Diving into the JavaScript Core, discusses the techniques to improve the expressiveness of the code, to master multi-line strings and templating, and to manipulate arrays and array-like objects. The chapter explains how to take advantage of JavaScript prototype without harming the readability your code. Further, the chapter introduces the "magic methods" of JavaScript and gives a practical example of their use.
Chapter 2, Modular Programming with JavaScript, describes the modularity in JavaScript: what modules are, why they are important, the standard approaches for asynchronously and synchronously loaded modules, and what ES6 modules are. The chapter shows how CommonJS modules are used in server-side JavaScript and how to pre-compile them for in-browser use. It elaborates how asynchronous and synchronous approaches can be combined to achieve a better application performance. It also explains how one can polyfill ES6 modules for production by the means of Babel.js.
Chapter 3, DOM Scripting and AJAX, introduces Document Object Model (DOM), shows the best practices to minimize browser reflow, and enhance application performance while operating with the DOM. The chapter also compares two client-server communication models: XHR and Fetch API.
Chapter 4, HTML5 APIs, considers the persistence APIs of the browser such as Web Storage, IndexDB, and FileSystem. It introduces Web Components and gives a walk-through of the creation of a custom component. The chapter describes server-to-browser communication APIs such as SSE and WebSockets.
Chapter 5, Asynchronous JavaScript, explains the nonblocking nature of JavaScript, elaborates the event loop and the call stack. The chapter considers the popular styles of chaining asynchronous calls and handling errors. It presents the async/await technique of ES7 and also gives examples of running tasks in parallel and in sequence using the Promise API and the Async.js library. It describes throttling and debouncing concepts.
Chapter 6, A Large-Scale JavaScript Application Architecture, focuses on code maintainability and architecture. The chapter introduces the MVC paradigm and its derivatives, MVP and MVVM. It also shows, with examples, how concern separation is implemented in popular frameworks such as Backbone.js, AngularJS, and ReactJS.
Chapter 7, JavaScript Beyond the Browser, explains how to write command-line programs in JavaScript and how to build a web server with Node.js. It also covers the creation of desktop HTML5 applications with NW.js and guides the development of native mobile applications with Phongap.
Chapter 8, Debugging and Profiling, dives into bug detection and isolation. It examines the capacities of DevTools and the lesser-known features of the JavaScript console API.