ABOUT THIS BOOK
xvii
Part 3 deals with the second pillar of JavaScript: objects. We’ll thoroughly explore
object orientation in JavaScript, and we’ll study how to guard access to objects and
how to deal with collections and regular expressions:
■
Objects are finally addressed in chapter 7, where we learn exactly how
JavaScript’s slightly strange flavor of object orientation works. We’ll also intro-
duce a new addition to JavaScript: classes, which, deep under the hood, may not
be exactly what you expect.
■
We’ll continue our exploration of objects in chapter 8, where we’ll study differ-
ent techniques for guarding access to our objects.
■
In chapter 9, we’ll put a special focus on different types of collections that exist
in JavaScript; on arrays, which have been a part of JavaScript since its begin-
nings; and on maps and sets, which are recent addition to JavaScript.
■
Chapter 10 focuses on regular expressions, an often-overlooked feature of the
language that can do the work of scores of lines of code when used correctly.
We’ll learn how to construct and use regular expressions and how to solve some
recurring problems elegantly, using regular expressions and the methods that
work with them.
■
In chapter 11, we’ll learn different techniques for organizing our code into
modules: smaller, relatively loosely coupled segments that improve the struc-
ture and organization of our code.
Finally, part 4 wraps up the book by studying how JavaScript interacts with our web
pages and how events are processed by the browser. We’ll finish the book by looking at
an important topic, cross-browser development:
■
Chapter 12 explores how we can dynamically modify our pages through DOM-
manipulation APIs, and how we can handle element attributes, properties, and
styles, as well as some important performance considerations.
■
Chapter 13 discusses the importance of JavaScript’s single-threaded execution
model and the consequences this model has on the event loop. We’ll also learn
how timers and intervals work and how we can use them to improve the per-
ceived performance of our web applications.
■
Chapter 14 concludes the book by examining the five key development con-
cerns with regard to these cross-browser issues: browser differences, bugs and
bug fixes, external code and markup, missing features, and regressions. Strate-
gies such as feature simulation and object detection are discussed at length to
help us deal with these cross-browser challenges.
Code conventions
All source code in listings or in the text is in a
fixed-width
font
like
this
to separate
it from ordinary text. Method and function names, properties, XML elements, and
attributes in the text are also presented in this same font.