06.07.2017 Views

Mastering JavaScript

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Table of Contents<br />

Preface<br />

vii<br />

Chapter 1: <strong>JavaScript</strong> Primer 1<br />

A little bit of history 2<br />

How to use this book 3<br />

Hello World 6<br />

An overview of <strong>JavaScript</strong> 6<br />

Comments 6<br />

Variables 7<br />

Constants 7<br />

Number 8<br />

String 11<br />

Undefined values 13<br />

Booleans 13<br />

The instanceof operator 15<br />

Date objects 15<br />

The + operator 16<br />

The ++ and -- operators 17<br />

Boolean operators 18<br />

Equality 25<br />

<strong>JavaScript</strong> types 27<br />

Automatic semicolon insertion 30<br />

<strong>JavaScript</strong> style guide 32<br />

Whitespaces 32<br />

Parentheses, line breaks, and braces 32<br />

Quotes 34<br />

End of lines and empty lines 34<br />

Type checking 35<br />

Type casting 35<br />

Conditional evaluation 36<br />

Naming 38<br />

[ i ]<br />

www.it-ebooks.info

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!