A Modern Introduction to Programming by Marijn Haverbeke
Publishing documents on edocr is a proven way to start demand generation for your products and services. Thousands of professionals and businesses publish marketing (brochures, data sheets, press releases, white papers and case studies), sales (slides, price lists and pro-forma agreements), operations (specifications, operating manuals, installation guides), customer service (user manuals) and financial (annual reports and financial statements) documents making it easier for prospects and customers to find content, helping them to make informed decisions. #SEO #leadgen #content #analytics
info@edocr.com
<p>Eloquent JavaScript
A Modern Introduction to Programming
Marijn Haverbeke
Copyright © 2014 by Marijn Haverbeke
This work is licensed under a Creative Commons attribution-noncommercial
license (http://creativecommons.org/licenses/by-nc/3.0/). All code in the
book may also be considered licensed under an MIT license (http://
opensource.org/licenses/MIT).
The illustrations are contributed by various artists: Cover by Wasif
Hyder. Computer (introduction) and unicycle people (Chapter 21) by
Max Xiantu. Sea of bits (Chapter 1) and weresquirrel (Chapter 4) by
Margarita Martínez and José Menor. Octopuses (Chapter 2 and 4) by
Jim Tierney. Object with on/off switch (Chapter 6) by Dyle MacGregor.
Regular expression diagrams in Chapter 9 generated with regexper.com
by Jeff Avallone. Game concept for Chapter 15 by Thomas Palef. Pixel
art in Chapter 16 by Antonio Perdomo Pastor.
The second edition of Eloquent JavaScript was made possible by 454
financial backers.
You can buy a print version of this book, with an extra bonus chapter
included, printed by No Starch Press at http://www.amazon.com/gp/product/
1593275846/ref=as_li_qf_sp_asin_il_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=
1593275846&linkCode=as2&tag=marijhaver-20&linkId=VPXXXSRYC5COG5R5.
i
Contents
On programming
. . . . . . . . . . . . . . . . . . . . . . . . . .
2
Why language matters . . . . . . . . . . . . . . . . . . . . . . .
4
What is JavaScript? . . . . . . . . . . . . . . . . . . . . . . . . .
6
Code, and what to do with it
. . . . . . . . . . . . . . . . . . .
8
Overview of this book . . . . . . . . . . . . . . . . . . . . . . . .
9
Typographic conventions . . . . . . . . . . . . . . . . . . . . . .
10
1 Values, Types, and Operators
11
Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
11
Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
12
Strings
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
15
Unary operators . . . . . . . . . . . . . . . . . . . . . . . . . . .
16
Boolean values . . . .