2dArrays in app lab

does app lab support 2d arrays?

thanks!

Of course, arrays in JavaScript can contain mixed types, so there’s no reason one or more of the elements of the array can’t be another array. For example if you wanted to access the “3” in the following array:
var a = [[2,3],"cat",87.5];
you would use
a[0][1]

1 Like

AppLab supports Javascript constructs however, there are no blocks in the toolboxes for two dimensional arrays.
Two Dimensional arrays in Javascript as @dougmmcnally mentioned above exist as arrays of objects. You cannot declare a 2D array. You can combine arrays and objects to make complex data structures. You’ll also have to write it out in text view.

var myStorage = { "car": { "inside": { "glove box": "maps", "passenger seat": "crumbs" }, "outside": { "trunk": "jack" } } }; var gloveBoxContents = myStorage.car.inside["glove box"]; // var gloveBoxContents = maps