-1

I was under the impression that an array of arrays is not allowed in javascript. Is that still true? Is the following object valid?

object: { array: [ [0],
                   ['1', '2']
                 ]
 }

Can someone please point me to examples of usage? I've been using arrays of strings as a workaround.

Lee DaBord
  • 11
  • 2

1 Answers1

0

It is allowed. Try this.

var arrayObj = [
  [1, 2],
  [3, 4],
  [5, 6]
];
console.log(arrayObj[0][0]); // first column/first row
console.log(arrayObj);
Avi Dubey
  • 794
  • 6
  • 16