Created
May 12, 2018 20:00
-
-
Save ancms2600/f40e593f934ff147f4a52f9221cf88dc to your computer and use it in GitHub Desktop.
Array .flatMap() Javascript shim (as per draft proposal)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Array.prototype.flatMap || (Array.prototype.flatMap = function () { // shim for draft proposal | |
return this.reduce(((acc,v)=>(acc.push(...v),acc)),[]); }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment