Skip to content

Instantly share code, notes, and snippets.

@greathmaster
Created October 11, 2019 18:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save greathmaster/26393bcf5defc9b04708503f42332869 to your computer and use it in GitHub Desktop.
Save greathmaster/26393bcf5defc9b04708503f42332869 to your computer and use it in GitHub Desktop.
Mapping over a 2D array in JS.
/*
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