JavaScript Guide

  • Edit
  • Watch

Table of contents

  1. 1. Quick Table of Contents
  2. 2. Expanded Table of Contents

    1. 2.1. About this Guide
    2. 2.2. JavaScript Overview
    3. 2.3. Values, variables, and literals
    4. 2.4. Expressions and operators
    5. 2.5. Regular Expressions
    6. 2.6. Statements
    7. 2.7. Functions
    8. 2.8. Working with objects
    9. 2.9. Predefined Core Objects
    10. 2.10. Details of the object model
    11. 2.11. Inheritance revisited
    12. 2.12. Iterators and generators
    13. 2.13. Closures
    14. 2.14. LiveConnect Overview
    15. 2.15. Processing XML with E4X
  • Tags
  • Files
Page Notifications
Off
Table of contents
  1. 1. Quick Table of Contents
  2. 2. Expanded Table of Contents

    1. 2.1. About this Guide
    2. 2.2. JavaScript Overview
    3. 2.3. Values, variables, and literals
    4. 2.4. Expressions and operators
    5. 2.5. Regular Expressions
    6. 2.6. Statements
    7. 2.7. Functions
    8. 2.8. Working with objects
    9. 2.9. Predefined Core Objects
    10. 2.10. Details of the object model
    11. 2.11. Inheritance revisited
    12. 2.12. Iterators and generators
    13. 2.13. Closures
    14. 2.14. LiveConnect Overview
    15. 2.15. Processing XML with E4X

Quick Table of Contents

  1. About this Guide
  2. JavaScript Overview
  3. Values, variables, and literals
  4. Expressions and operators
  5. Regular Expressions
  6. Statements
  7. Functions
  8. Working with objects
  9. Predefined Core Objects
  10. Details of the object model
  11. Inheritance revisited
  12. Iterators and generators
  13. Closures
  14. LiveConnect Overview
  15. Processing XML with E4X

Expanded Table of Contents

About this Guide

  1. 1. New features in JavaScript versions
  2. 2. What you should already know
  3. 3. JavaScript versions
  4. 4. Where to find JavaScript information
  5. 5. Tips for learning JavaScript

    1. 5.1. An interactive interpreter
    2. 5.2. Firebug
  6. 6. Document conventions

JavaScript Overview

  1. 1. What is JavaScript?
  2. 2. JavaScript and Java
  3. 3. JavaScript and the ECMAScript Specification

    1. 3.1. Relationship between JavaScript Versions and ECMAScript Editions
    2. 3.2. JavaScript Documentation versus the ECMAScript Specification
    3. 3.3. JavaScript and ECMAScript Terminology

Values, variables, and literals

  1. 1. Values

    1. 1.1. Data type conversion
    2. 1.2. Converting strings to numbers

      1. 1.2.1. parseInt() and parseFloat()
      2. 1.2.2. Plus operator
  2. 2. Variables

    1. 2.1. Declaring variables
    2. 2.2. Evaluating variables
    3. 2.3. Variable scope
    4. 2.4. Global variables
    5. 2.5. See also
  3. 3. Constants
  4. 4. Literals

    1. 4.1. Array literals

      1. 4.1.1. Extra commas in array literals
    2. 4.2. Boolean literals
    3. 4.3. Integers
    4. 4.4. Floating-point literals
    5. 4.5. Object literals
    6. 4.6. String literals

      1. 4.6.1. Using special characters in strings
      2. 4.6.2. Escaping characters
  5. 5. Unicode

    1. 5.1. Unicode compatibility with ASCII and ISO
    2. 5.2. Unicode escape sequences
    3. 5.3. Unicode characters in JavaScript files
    4. 5.4. Displaying characters with Unicode

Expressions and operators

  1. 1. Expressions
  2. 2. Operators

    1. 2.1. Assignment operators
    2. 2.2. Comparison operators
    3. 2.3. Arithmetic operators
    4. 2.4. Bitwise operators

      1. 2.4.1. Bitwise logical operators
      2. 2.4.2. Bitwise shift operators
    5. 2.5. Logical operators

      1. 2.5.1. Short-circuit evaluation
    6. 2.6. String operators
    7. 2.7. Special operators

      1. 2.7.1. Conditional operator
      2. 2.7.2. Comma operator
      3. 2.7.3. delete
      4. 2.7.4. in
      5. 2.7.5. instanceof
      6. 2.7.6. new
      7. 2.7.7. this
      8. 2.7.8. typeof
      9. 2.7.9. void
    8. 2.8. Operator precedence

Regular Expressions

  1. 1. Creating a Regular Expression
  2. 2. Writing a Regular Expression Pattern

    1. 2.1. Using Simple Patterns
    2. 2.2. Using Special Characters
    3. 2.3. Using Parentheses
  3. 3. Working with Regular Expressions

    1. 3.1. Using Parenthesized Substring Matches

      1. 3.1.1. Example 1
    2. 3.2. Advanced Searching With Flags
  4. 4. Examples

    1. 4.1. Changing the Order in an Input String
    2. 4.2. Using Special Characters to Verify Input

Statements

  1. 1. Block Statement
  2. 2. Conditional Statements

    1. 2.1. if...else Statement
    2. 2.2. switch Statement
  3. 3. Loop Statements

    1. 3.1. for Statement
    2. 3.2. do...while Statement
    3. 3.3. while Statement
    4. 3.4. label Statement
    5. 3.5. break Statement
    6. 3.6. continue Statement
  4. 4. Object Manipulation Statements

    1. 4.1. for...in Statement
    2. 4.2. for each...in Statement
  5. 5. Comments
  6. 6. Exception Handling Statements

    1. 6.1. Exception Types
    2. 6.2. throw Statement
    3. 6.3. try...catch Statement

      1. 6.3.1. The catch Block
      2. 6.3.2. The finally Block
      3. 6.3.3. Nesting try...catch Statements
    4. 6.4. Utilizing Error objects

Functions

  1. 1. Defining functions
  2. 2. Calling functions
  3. 3. Function scope
  4. 4. Closures
  5. 5. Using the arguments object
  6. 6. Predefined functions

    1. 6.1. eval Function
    2. 6.2. isFinite function
    3. 6.3. isNaN function
    4. 6.4. parseInt and parseFloat functions
    5. 6.5. Number and String functions
    6. 6.6. escape and unescape functions

Working with objects

  1. 1. Objects overview
  2. 2. Objects and properties
  3. 3. Object everything
  4. 4. Enumerating all properties of an object
  5. 5. Creating new objects

    1. 5.1. Using object initializers
    2. 5.2. Using a constructor function
    3. 5.3. Using the Object.create method
    4. 5.4. Inheritance
    5. 5.5. Indexing object properties
    6. 5.6. Defining properties for an object type
    7. 5.7. Defining methods
    8. 5.8. Using this for object references
    9. 5.9. Defining getters and setters

      1. 5.9.1. Obsolete syntaxes
      2. 5.9.2. Summary
      3. 5.9.3. See also
    10. 5.10. Deleting properties
  6. 6. See also