please dont rip this site

JavaScript: The Definitive Guide

Previous Chapter 21
JavaScript Reference
Next
 

Array Object

Name

Array Object---built-in support for arrays

Availability

Navigator 3.0, Internet Explorer 3.0; arrays are available in Navigator 2.0, but the Array object class that supports them is not.

Constructor

new Array()
new Array(size)
new Array(element0, element1, ..., elementn)

Arguments

size

The desired number of elements in the array. The returned array will have its length field set to size.

element0, ...elementn

An argument list of two or more arbitrary values. When the Array() constructor is invoked with these arguments, the newly created array will be initialized with the specified argument values as its elements, and its length field set to the number of arguments.

Returns

The newly created and initialized array. When Array() is invoked with no arguments, the returned array will have a length field of 0.

Properties

length

A read/write integer specifying the number of elements in the array, or, when the array does not have contiguous elements, a number one larger than the index of the last element in the array.

Methods

join

Convert all array elements to strings and concatenate them.

reverse

Reverse, in place, the order of the elements of an array.

sort

Sort, in place, the elements of an array.

Description

Arrays are a basic syntactic feature of JavaScript. All JavaScript objects, regardless of their type, may be used as arrays. The dual nature of arrays and objects is discussed in Chapter 8, Arrays, along with full details on the JavaScript syntax for reading and setting array elements.

The Array is a new object type, added in Navigator 3.0, which, along with the usual array capabilities that all JavaScript objects have, also provides additional array functionality: a constructor function for initializing arrays, an automatically updated length field that stores the size of the array, and join(), reverse(), and sort() methods that manipulate the elements of an array. See the individual reference pages for details.

See Also

"Object", Chapter 8, Arrays


Previous Home Next
Area Book Index Array.join()

HTML: The Definitive Guide CGI Programming JavaScript: The Definitive Guide Programming Perl WebMaster in a Nutshell

file: /Techref/language/java/script/definitive/refp_09.htm, 6KB, , updated: 2019/10/14 15:00, local time: 2024/11/15 02:53,
TOP NEW HELP FIND: 
3.138.69.214:LOG IN

 ©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE!

<A HREF="http://linistepper.com/techref/language/java/script/definitive/refp_09.htm"> [Chapter 21] Reference: Array</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.


Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?