In Javascript, it is possible to flatten an array of arrays with Array.prototype.flat() (you can test it in Chrome's developer console) :
const a = [1, 2, 3]
const b = [4, 5, 6]
const arr = [a, b]
console.log(arr.flat())
Output :
[1, 2, 3, 4, 5, 6]
Now, if I try the same code in TypeScript, I get the following error :
TS2339: Property 'flat' does not exist on type 'number[][]'.
Why ? Is it simply not included in TypeScript ? It does not seem to be a recent nor non-standard feature. Is there another way to call this function ?
There are other ways to flatten arrays of arrays but I find them hardly readable.