JavaArray object (Object/Navigator)

A JavaScript data type that encapsulates a Java array.

Availability:

JavaScript - 1.1
Netscape - 3.0
JavaScript syntax:NmyJavaArray = myWindow.Packages
Object properties:length
Object methods:toString()

In Java, objects can be collected together into arrays. This is also true of JavaScript. However, as you might expect, some encapsulation of the Java array is necessary to be able to operate on it from a JavaScript environment. The JavaArray object does just this. It supports some JavaScript-like behaviour in that it has a length property and can be accessed element by element using the JavaScript [] notation. JavaArray objects can be stacked to make multidimensional arrays and they can also be traversed with a for( ... in ... ) ... loop.

At version 1.4 of JavaScript, a JavaArray object inherits properties from the java.lang.Object super-class.

See also:Array object, Collection object, Java to JavaScript values, JavaScript to Java values, LiveConnect, Window.Packages

PropertyJavaScriptJScriptNIEOperaNESECMADOMCSSHTMLNotes
length1.1 1.1 n/a3.0 3.0 n/a n/a n/a n/a n/a n/a n/aReadOnly.

MethodJavaScriptJScriptNIEOperaNESECMADOMCSSHTMLNotes
toString()1.1 1.1 n/a3.0 3.0 n/a n/a n/a n/a n/a n/a n/a-