What’s in This Book?

The rest of this book is organized as follows.

Before we dig into the newer features of JavaScript, we’ll quickly visit some old problem areas in Chapter 1, JavaScript Gotchas. You’ll learn about things to avoid and the safe alternatives to some nefarious features.

Chapter 2, Variables and Constants will encourage you to replace var with let or const and why you should prefer const where possible.

JavaScript has always had support for flexible parameters, but it was not intuitive and was also error prone. Chapter 3, Working with Function Arguments will show how the newer features of JavaScript make working with parameters safe, expressive, and pleasant.

The enhanced for loop of modern JavaScript is the antidote for the boredom of the common loops. We discuss different ways to loop, along with the generators and how to create infinite sequences, in Chapter 4, Iterators and Symbols.

The lexical scoping semantics of anonymous functions is inconsistent and confusing, to say the least. Arrow functions don’t have majority of the problems that are inherent in anonymous functions. But arrow functions come with some limitations as well, as we’ll see in Chapter 5, Arrow Functions and Functional Style. In this chapter, we’ll also see how arrow functions make it easy to create functional style code.

Hands down, one of the most exciting features of JavaScript is destructuring. In Chapter 6, Literals and Destructuring we’ll unleash the power of destructuring along with features like template literals and enhanced object literals.

JavaScript has supported classes for a long time, but without the class keyword. Sadly, that created problems. The newer class-related syntax in JavaScript makes writing object-oriented code much simpler, as we’ll see in Chapter 7, Working with Classes.

Unlike many other languages that support class-based inheritance, JavaScript has prototypal inheritance. Even though this feature is highly powerful and flexible, using it has been hard in the past—with the syntax confusing and error prone. As we’ll see in Chapter 8, Using Inheritance, it’s now much easier, and safer, to use inheritance.

In Chapter 9, Using Modules, you’ll learn to work with multiple JavaScript files and the rules of module import and export.

Asynchronous programming is a way of life in JavaScript, and you need a fairly good knowledge of how promises work to master that. Chapter 10, Keeping Your Promises, has you covered, I promise.

There’s something magical about metaprogramming—the ability to create programs that can create programs. In Chapter 11, Exploring Metaprogramming, we’ll explore one type of metaprogramming—injection.

Then, in Chapter 12, Deep Dive into Metaprogramming, we dig into another type of metaprogramming—synthesis—and how to create highly dynamic code.

Appendix 1, Answers to Exercises has solutions for exercises at the end of each chapter, for you to compare notes with the solutions you create.

Finally, for your convenience, the URLs that are scattered throughout this book are gathered in one place in Appendix 2, Web Resources.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.148.102.90