Created
October 11, 2019 18:24
-
-
Save greathmaster/26393bcf5defc9b04708503f42332869 to your computer and use it in GitHub Desktop.
Mapping over a 2D array in JS.
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
/* | |
Mapping over a 2D array in JS. | |
Taken from: https://stackoverflow.com/questions/45659734/how-to-use-array-map-with-a-2-dimensional-array | |
*/ | |
arr.map( function( row ) { | |
return row.map( function( cell ) { | |
return foo( cell ); | |
} ); | |
} ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment