New Features in this Release
- 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
escapeandunescape. See the Client-Side JavaScript Guide for details. - Changes to the Array object.
-
When you specify a single numeric parameter with the
Arrayconstructor, you specify the initial length of the array. -
The
pushmethod returns the new length of the array rather than the last element added to the array. -
The
splicemethod always returns an array containing the removed elements, even if only one element is removed. -
The
toStringmethod 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
lengthproperty 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
Dateconstructor. -
Added the
getFullYear,setFullYear,getMilliseconds, andsetMillisecondsmethods. -
Added the
getUTCDate,getUTCDay,getUTCFullYear,getUTCHours,getUTCMilliseconds,getUTCMinutes,getUTCMonth,getUTCSeconds,setUTCDate,setUTCFullYear,setUTCHours,setUTCMilliseconds,setUTCMinutes,setUTCMonth,setUTCSeconds, andtoUTCStringmethods. -
Added a day parameter to the
setMonthmethod. -
Added minutes, seconds, and milliseconds parameters to the
setHoursmethod. -
Added seconds and milliseconds parameters to the
setMinutesmethod. -
Added a milliseconds parameter to the
setSecondsmethod. -
Added a milliseconds parameter to the
UTCmethod. -
Deprecated the
getYear,setYear, andtoGMTStringmethods. - Changes to the Function object.
-
Added the
applymethod, which allows you to apply a method of another object in the context of a different object (the calling object). -
Added the
callmethod, which allows you to call (execute) a method of another object in the context of a different object (the calling object). -
Deprecated the
arguments.callerproperty. - Changes to the String object.
-
The
charCodeAtandfromCharCodemethods use Unicode values rather than ISO-Latin-1 values. -
The
replacemethod supports the nesting of a function in place of the second argument. -
New method toSource. The
toSourcemethod returns a string representing the source code of the object. SeeArray.toSource,Boolean.toSource,Date.toSource,Function.toSource,Number.toSource,Object.toSource,RegExp.toSource, andString.toSource. -
New top-level properties Infinity, NaN, and undefined.
Infinityis a numeric value representing infinity.NaNis a value representing Not-A-Number.undefinedis the value undefined. -
New top-level function isFinite.
isFiniteevaluates an argument to determine whether it is a finite number. -
Changes to the top-level eval function. You should not indirectly use the
evalfunction by invoking it via a name other thaneval. -
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 convertedif(x = y)toif(x == y), but 1.3 generates a runtime error. See "if...else" on page 623. -
Any object whose value is not
undefinedornull, 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
