Sunday, October 30, 2011

Notes about "JavaScript: The Definition Guide" of David Flanagan

Chapter 1: Introduction to JavaScript
there are :
  • the core JavaScript language = minimal API without I/O functions
  • client-side JavaScript = hosting environment (browser)
Development environment : Firebug 
to debug : console.log() or alert()


Chapter 2: Lexical Structure
  • Character Set
    • support Unicode
    • Case Sensitive
    • ignores Whitespace
  • Comments
 // This is a single-line comments.
 /* This is also a comment */  // and here is another comment.
 /*
  * This is yet another comment.
  * It has multiple lines
  */
  • Literal
   12             // The number twelve
 1.2            // The number one point two
 "hello world"  // A string of text
 'Hi'           // Another string
 true           // A Boolean value
 false          // The other Boolean value
 /javascript/gi // A "regular expression" literal (for pattern  
 matching)
 null           // Absence of an object
{ x:1, y:2 }    // An object initializer
[ 1, 2, 3, 4 ]  // An array initializer