it should be as simple as:
create
var arr = new Array(5,5);
access
var x = arr[3,2];
update
arr[2,2] = 5;
Other possible useful methods could be: max, min, sum, … or we could do what numpy does and allow arithmetic operations to apply element-wise two arrays. Additional separate libraries could then implement FFTs, convolution etc … but that would not get in the way of the simple clear basics suitable for beginners.
Given P5 is primarily used to create designs, visualising arrays should be part of definition. eg
plot
arr.plot(location_x, location_y)
… with additional options for scale and colour mapping, now we’re getting into to more advanced optional functions. This proposal is about getting the foundations right.
I don’t think the zero-indexing thing is a major issue, but others may have more informed views on that. Processing’s top-left as the origin causes more problems than 0-indexing in my 5+ years experience of teaching 7-17 year olds to code.
For me, creating a 2d array in javascript is particularly unpleasant, complicated, and even the “one-liners” require advanced incantations.