Multidimensional Arrays

Multidimensional arrays can be easily achieved by adding a child array as an input to a parent array. This is exactly like adding an object to an array (except the object in this case is an Array). See below.
var foo = [ ["hello", "hi"], ["bye", "see you"] ];

Screen.Write(foo); // prints: [ [hello, hi], [bye, see you] ]
Screen.Write(foo[0]); // prints: [hello, hi]
Screen.Write(foo[0][1]); // prints: see you

foo[0].Push("chao");

Screen.Write(foo); // prints: [ [hello, hi], [bye, see you, chao] ]
updated 21 months and one week ago by guest