| Availability: |
| |||
| JavaScript syntax: | N | myJavaArray = 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.
| Property | JavaScript | JScript | N | IE | Opera | NES | ECMA | DOM | CSS | HTML | Notes |
|---|---|---|---|---|---|---|---|---|---|---|---|
| length | 1.1 ![]() | ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ReadOnly. |
| Method | JavaScript | JScript | N | IE | Opera | NES | ECMA | DOM | CSS | HTML | Notes |
|---|---|---|---|---|---|---|---|---|---|---|---|
| toString() | 1.1 ![]() | ![]() | 3.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
| Prev | Home | Next |
| java.util.Date | Up | JavaArray.length |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. | ||