Java™ arrays
Java™ arrays can be embedded in the JavaScript™ code without prior declarations or inclusions. This provides the ability to create multi-dimension arrays and to pass them as parameters to Java™ methods included in the JavaScript™ code.
The following example is a computed field that creates, populates, and displays a multi-dimension array.
var a = new int[2][3];
for(var i = 0; i < 2; i++) {
for(var j = 0; j < 3; j++) {
a[i][j] = i + j;
}
}
a[0][0] + " " + a[1][0] + "\n" +
a[0][1] + " " + a[1][1] + "\n" +
a[0][2] + " " + a[1][2]
The resulting computed field appears as follows:
0 1
1 2
2 3