Is this book for you? The following items can help you determine that:
This book has been written for programmers, by a programmer. So, in order to understand it, you should already know object-oriented programming, for example, via a mainstream programming language such as Java, PHP, C++, Python, Ruby, Objective-C, C#, or Perl.
This book is divided into four parts, but the main two are:
These parts are completely independent! You can treat them as if they were separate books: the former is more like a guide, the latter is more like a reference. The Four Parts of This Book tells you more about the structure of this book.
This book is organized into four parts:
While reading this book, you may want to have a command line ready. That allows you to try out code interactively. The most popular choices are:
The following notational conventions are used throughout the book.
Question marks (?) are used to mark optional parameters. For example:
French quotation marks (guillemets) denote metacode. You can think of such metacode as blanks, to be filled in by actual code. For example:
“White” square brackets mark optional syntactic elements. For example:
// calling function `foo` with parameters `x` and `y`
I refer to built-in methods via their full path:
Array.prototype.join() refers to the array method
Array instances in the object
Array.prototype. The reason for this is explained in Layer 3: Constructors—Factories for Instances.
> 3 + 4 7
console.log() to print data to the console, especially in (non–command-line) source code:
This element signifies a tip or suggestion.
This element signifies a general note.
This element indicates a warning or caution.
While you can obviously use this book as a reference, sometimes looking up information online is quicker. One resource I recommend is the Mozilla Developer Network (MDN). You can search the Web to find documentation on MDN. For example, the following web search finds the documentation for the
push() method of arrays:
mdn array push
Technology professionals, software developers, web designers, and business and creative professionals use Safari Books Online as their primary resource for research, problem solving, learning, and certification training.
Members have access to thousands of books, training videos, and prepublication manuscripts in one fully searchable database from publishers like O’Reilly Media, Prentice Hall Professional, Addison-Wesley Professional, Microsoft Press, Sams, Que, Peachpit Press, Focal Press, Cisco Press, John Wiley & Sons, Syngress, Morgan Kaufmann, IBM Redbooks, Packt, Adobe Press, FT Press, Apress, Manning, New Riders, McGraw-Hill, Jones & Bartlett, Course Technology, and hundreds more. For more information about Safari Books Online, please visit us online.
Please address comments and questions concerning this book to the publisher:
|O’Reilly Media, Inc.|
|1005 Gravenstein Highway North|
|Sebastopol, CA 95472|
|800-998-9938 (in the United States or Canada)|
|707-829-0515 (international or local)|
We have a web page for this book, where we list errata, examples, and any additional information. You can access this page at http://oreil.ly/speaking-js.
To comment or ask technical questions about this book, send email to email@example.com.
For more information about our books, courses, conferences, and news, see our website at http://www.oreilly.com.
Find us on Facebook: http://facebook.com/oreilly
Follow us on Twitter: http://twitter.com/oreillymedia
Watch us on YouTube: http://www.youtube.com/oreillymedia
I would like to thank the following people, all of whom helped make this book possible.
More sources are acknowledged in the chapters.
I am much obliged to the following people who reviewed this book. They provided important feedback and corrections. In alphabetical order: