Skip to content

Instantly share code, notes, and snippets.

@ricardodantas
Created March 22, 2021 14:56
Show Gist options
  • Save ricardodantas/53082a5fbf763447f0910dd7f845cb99 to your computer and use it in GitHub Desktop.
Save ricardodantas/53082a5fbf763447f0910dd7f845cb99 to your computer and use it in GitHub Desktop.
Transpose 2D array (ES6)
const transpose = a => a[0].map((_, c) => a.map(r => r[c]));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment