Core JavaScript Reference

This book is a reference manual for the core JavaScript language for version 1.5. JavaScript is Netscape's cross-platform, object-based scripting language. Core JavaScript can be extended for a variety of purposes by supplementing it with additional objects.

JavaScript version 1.5 provides the following features and enhancements:

  • Runtime errors. Runtime errors are now reported as exceptions.
  • Number formatting enhancements. Number formatting has been enhanced to include Number.prototype.toExponential, Number.protoytpe.toFixed and Number.prototype.toPrecision methods. See page 127, page 128, and page 129.
  • Regular expression enhancements:
    (1) Greedy quantifiers - +, *, ? and {} - can now be followed by a ? to force them to be non-greedy. See the entry for ? on page 148.
    (2) Non-capturing parentheses, (?:x) can be used instead of capturing parentheses(x). When non-capturing parentheses are used, matched subexpressions are not available as back-references. See the entry for (?:x) on page 148.
    (3) Positive and negative lookahead assertions are supported. Both assert a match depending on what follows the string being matched. See the entries for (?=) and (?!) on page 148.
    (4) The m flag has been added to specify that the regular expression should match over multiple lines. See page 146.
  • Conditional function declarations. Functions can now be declared inside an if clause. See page 221.
  • Function expressions. Functions can now be declared inside an expression. See page 254.
  • Multiple catch clauses. Multiple catch clauses in a try...catch statement are supported. See page 231.
  • Constants. Readonly, named constants are supported. This feature is available only in the C implementation of JavaScript. See page 215.
  • Getters and Setters. JavaScript writers can now add getters and setters to their objects. This feature is available only in the C implementation of JavaScript. See Defining Getters and Setters in Chapter 7 of the Core JavaScript Guide for information about this feature.

Click to Read More

Followers