Table of Contents | Previous | Next | Index

## New Features in this Release

JavaScript version 1.3 provides the following new features and enhancements:

- ECMA compliance. JavaScript 1.3 is fully compatible with ECMA-262. See the Client-Side JavaScript Guide for details.

- Unicode support. The Unicode character set can be used for all known encoding, and you can use the Unicode escape sequence in string literals. See `escape` and `unescape`. See the Client-Side JavaScript Guide for details.

- Changes to the Array object.

- When you specify a single numeric parameter with the `Array` constructor, you specify the initial length of the array.
- The `push` method returns the new length of the array rather than the last element added to the array.
- The `splice` method always returns an array containing the removed elements, even if only one element is removed.
- The `toString` method joins an array and returns a string containing each array element separated by commas, rather than returning a string representing the source code of the array.
- The `length` property contains an unsigned, 32-bit integer with a value less than 232.

- Changes to the Date object.

- Removed platform dependencies to provide a uniform behavior across platforms.
- Changed the range for dates to -100,000,000 days to 100,000,000 days relative to 01 January, 1970 UTC.
- Added a milliseconds parameter to the `Date` constructor.
- Added the `getFullYear`, `setFullYear`, `getMilliseconds`, and `setMilliseconds` methods.
- Added the `getUTCDate`, `getUTCDay`, `getUTCFullYear`, `getUTCHours`, `getUTCMilliseconds`, `getUTCMinutes`, `getUTCMonth`, `getUTCSeconds`, `setUTCDate`, `setUTCFullYear`, `setUTCHours`, `setUTCMilliseconds`, `setUTCMinutes`, `setUTCMonth`, `setUTCSeconds`, and `toUTCString` methods.
- Added a day parameter to the `setMonth` method.
- Added minutes, seconds, and milliseconds parameters to the `setHours` method.
- Added seconds and milliseconds parameters to the `setMinutes` method.
- Added a milliseconds parameter to the `setSeconds` method.
- Added a milliseconds parameter to the `UTC` method.
- Deprecated the `getYear`, `setYear`, and `toGMTString` methods.

- Changes to the Function object.

- Added the `apply` method, which allows you to apply a method of another object in the context of a different object (the calling object).
- Added the `call` method, which allows you to call (execute) a method of another object in the context of a different object (the calling object).
- Deprecated the `arguments.caller` property.

- Changes to the String object.

- The `charCodeAt` and `fromCharCode` methods use Unicode values rather than ISO-Latin-1 values.
- The `replace` method supports the nesting of a function in place of the second argument.

- New method toSource. The `toSource` method returns a string representing the source code of the object. See `Array.toSource`, `Boolean.toSource`, `Date.toSource`, `Function.toSource`, `Number.toSource`, `Object.toSource`, `RegExp.toSource`, and `String.toSource`.

- New top-level properties Infinity, NaN, and undefined. `Infinity` is a numeric value representing infinity. `NaN` is a value representing Not-A-Number. `undefined` is the value undefined.

- New top-level function isFinite. `isFinite` evaluates an argument to determine whether it is a finite number.

- Changes to the top-level eval function. You should not indirectly use the `eval` function by invoking it via a name other than `eval`.

- New strict equality operators === and !==. The `===` (strict equal) operator returns true if the operands are equal and of the same type. The `!==` (strict not equal) operator returns true if the operands are not equal and/or not of the same type. See "Comparison Operators" on page 635 and "Using the Equality Operators" on page 637.

- Changes to the equality operators == and !=. The use of the `==` (equal) and `!=` (not equal) operators reverts to the JavaScript 1.1 implementation. If the two operands are not of the same type, JavaScript attempts to convert the operands to an appropriate type for the comparison. See "Using the Equality Operators" on page 637.

- Changes to the behavior of conditional tests.

- You should not use simple assignments in a conditional statement; for example, do not specify the condition `if(x = y)`. Previous JavaScript versions converted `if(x = y)` to `if(x == y)`, but 1.3 generates a runtime error. See "if...else" on page 623.
- Any object whose value is not `undefined` or `null`, including a Boolean object whose value is false, evaluates to true when passed to a conditional statement. See "Boolean" on page 51.

- The JavaScript console. The JavaScript console is a window that can display all JavaScript error messages. Then, when a JavaScript error occurs, the error message is directed to the JavaScript console and no dialog box appears. See the Client-Side JavaScript Guide for details.

Table of Contents | Previous | Next | Index

Last Updated: 05/28/99 11:58:55

Copyright (c) 1999 Netscape Communications Corporation