According to the Mozilla Developer Website:
The flatMap() method first maps each element using a mapping function, then flattens the result into a new array. It
I was getting this when testing with jest, it's because flatmap
is only part of node 11 and I was using node 10.
As a workaround, I added require('core-js/stable');
in my setupTests.ts
.
I presume also there are some browsers that won't have this either. As such I will also put that require line in my application imports somewhere.