If you declare an array, you have to assign its elements (or at least acknowledge that it is an array) while declaring it, i.e., var myArray = [1, 2, 3];.
I'm curious as to how one might be able to implement that in an class constructor, for example:
function Matrix(MultiDimensionalArray) {
this.array = MultiDimensionalArray;
}
var myMatrix = new Matrix() [
[1, 2, 3],
[4, 5, 6],
[7, 8, 9]
];
That's the closest thing I could think of to implement this, but I know that it's incorrect. What is the right way to go about this?
,) after every item. Second, your nested array should be passed between parenthesis. Also, functions are declared asfunction functionMName(argumentList) { function body}