Add Array.flatMap() polyfill.
parent
993c873fcc
commit
478689278a
@ -0,0 +1,9 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
if (!Array.prototype.flatMap) {
|
||||||
|
Object.defineProperty(Array.prototype, 'flatMap', {
|
||||||
|
value: function(callback) {
|
||||||
|
return [].concat(...this.map(callback));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
Loading…
Reference in New Issue