Classes | Collections > Ordered

Array2D : Collection : Object

two-dimensional array


Represents a two-dimensional array of data. The number of rows and columns is fixed.

NOTE: It is possible to implement a similar behaviour using an "array-of-arrays" - see the examples towards the bottom of this page for comparison.

Class Methods 1, cols: 1)

Create an array of the specified size.

Array2D.fromArray(rows, cols, array)

Build an Array2D from the supplied array.

Inherited class methods

Instance Methods

.at(row, col)

Get a value from the array.

.put(row, col, val)

Put a value into the array.


Iterate over the columns. Each column will be passed to func in turn.


Iterate over the rows. Each row will be passed to func in turn.


Retrieve a single column.


Retrieve a single row.


Return a flat array containing the elements.


Inherited instance methods

Undocumented instance methods