Matrix Multiplication in Typescript
Concise Function Body

The function body of an arrow function can be concise.

For instance can getMatrixColumns shorten to

export const getMatrixColumns = (a: number[][]) =&gt; a[0].length;




Method Name

The method names getMatrixColumns and getMatrixRows let me expect that the the methods return a number[] instead of a number. 

A better fit are getMatrixColumnLength and getMatrixRowLength.



Redundant Method Names

Each method name expect dotProduct contains some how the word matrix.

It is sufficient if the methods are grouped in a Matrix module and have names like:

// in matrix.js

export const columnLenghtOf = (a: number[][]) =&gt; 
    a[0].length;

export const rowLengthOf = (a: number[][]) =&gt; 
    a.length;

export const areValid = (a: number[][], b: number[][]) =&gt;
    columnLenghtOf(a) === columnLenghtOf(b);

/* ... */




Type Alias

Matrix could be a type alias for number[][]:

// in matrix.js

type Matrix = number[][]

export const columnLenghtOf = (a: Matrix) =&gt; 
    a[0].length;
```