In Typescript, you will create a Matrix / Multimimensional 2x6 array using this syntax:
var matrix: number[][] = [ [ -1, 1, 2, -2, -3, 0 ], [ 0.1, 0.5, 0, 0, 0, 0 ] ];
The equivalent in JavaScript will look like this:
var matrix = [ [ -1, 1, 2, -2, -3, 0 ], [ 0.1, 0.5, 0, 0, 0, 0 ] ];
JavaScript syntax is also valid in TypeScript, since types are optional, but Typescript syntax is not valid in JavaScript.
To get different lengths, you have to use the same syntax in JS and TS:
var matrixLength = matrix.length;
source share