Visit Mozilla.org

New in JavaScript 1.5

From MDC


JavaScript version 1.5 provided the following new 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.prototype.toFixed and Number.prototype.toPrecision methods. See the Number Object page.

Regular expression enhancements
The following regular expression enhancements have been added:

Conditional function declarations
Functions can now be declared inside an if clause. See the Defining Functions page.

Function expressions
Functions can now be declared inside an expression. See the Defining Functions page.

Multiple catch clauses
Multiple catch clauses in a try...catch statement are supported. See The catch Block page.

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 the Defining Getters and Setters page.

Constants
Read only named constants are supported. This feature is available only in the C implementation of JavaScript. See the Constants page.