Array
objects can be created using literal notation.<SCRIPT>
tag includes LANGUAGE="JavaScript1.2"
, array(1)
creates a new array with a[0]=1
.concat
joins two arrays and returns a new array.pop
removes the last element from an array and returns that element.push
adds one or more elements to the end of an array and returns that last element added.shift
removes the first element from an array and returns that elementunshift
adds one or more elements to the front of an array and returns the new length of the array.slice
extracts a section from an array and returns a new arraysplice
adds and/or removes elements from an array and returns the removed elements.sort
now works on all platforms. It no longer converts undefined elements to null; instead, it sorts them to the high end of the array.Function
.arity
property indicates the number of arguments expected by a function.arguments.callee
property provides information about the invoked function.Lock
class allows safe sharing of information with multiple incoming requests.Number
now produces NaN rather than an error if x is a string that does not contain a well-formed numeric literal.String
methods match
, replace
, search
, and split
. The RegExp
object has properties most of which are set when a match is successful, such as lastMatch
which specifies the last successful match. The Array
object has new properties that provide information about a successful match such as input
which specifies the original input string against which the match was executed. See RegExp
for information.SendMail
class lets you generate email from JavaScript.charCodeAt
returns a number specifying the ISO-Latin-1 codeset value of the character at the specified index in a string object.concat
combines the text of two strings and returns a new string.fromCharCode
constructs a string from a specified sequence of numbers that are ISO-Latin-1 codeset values.match
executes a search for a match between a string and a regular expression.replace
executes a search for a match between a string and a regular expression, and replaces the matched substring with a new substring.search
tests for a match between a string and a regular expression.slice
extracts a section of an string and returns a new string.split
includes several new features and changes. It can take a regular expression argument, as well as a fixed string, by which to split the object string. It can take a limit count so that it won't include trailing empty elements in the resulting array. If you specify LANGUAGE="JavaScript1.2"
in the <SCRIPT>
tag, string
.split(" ")
splits on any run of one or more white space characters including spaces, tabs, line feeds, and carriage returns.substr
returns the characters in a string collecting the specified number of characters beginning with a specified location in the string.substring
if you specify LANGUAGE="JavaScript1.2"
in the <SCRIPT>
tag, this method no longer swaps index numbers when the first index is greater than the second.Number
function converts an object to a number. The String
function converts an object to a string.eval
is no longer a method of individual objects; it is available only as a top-level function.toString
converts an object or array to a literal. For this behavior, LANGUAGE="JavaScript1.2"
must be specified in the <SCRIPT>
tag.watch
is a new method of all objects. It watches for a property to be assigned a value and runs a function when that occurs.unwatch
is a new method of all objects. It removes a watchpoint set with the watch
method.delete
operator deletes an object, an object's property, or an element at a specified index in an array. See "delete" on page 395.<SCRIPT>
tag uses LANGUAGE=JavaScript1.2
, the equality operators ==
and !=
do not attempt to convert operands from one type to another, and always compare identity of like-typed operands. See "Comparison Operators" on page 385.break
and continue
statements can now be used with the new labeled
statement.do...while
repeats a loop until the test condition evaluates to false.export
allows a signed script to provide functions to other signed or unsigned scripts.import
allows a script to import functions from a signed script which has exported the information.label
allows the program to break outside nested loops or to continue a loop outside the current loop.switch
allows the program to test several conditions easily.Last Updated: 11/13/98 10:22:42