Skip to content

Instantly share code, notes, and snippets.

@codergautam
Created January 14, 2022 16:05
Show Gist options
  • Save codergautam/b7d88f5b02a871440aae9021f38956a9 to your computer and use it in GitHub Desktop.
Save codergautam/b7d88f5b02a871440aae9021f38956a9 to your computer and use it in GitHub Desktop.
Transpose an array!
const transpose = (m)=>m[0].map((_, i) => m.map(r => r[i]));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment