Skip to content

Instantly share code, notes, and snippets.

@zazaulola
Last active July 29, 2024 23:10
Show Gist options
  • Save zazaulola/18e23fc5d505d791e29e2d2c6daa7163 to your computer and use it in GitHub Desktop.
Save zazaulola/18e23fc5d505d791e29e2d2c6daa7163 to your computer and use it in GitHub Desktop.
// Matrices multiply
const multiply = (a, b) =>
[...a].map((_, r) =>
[...b[0]].map((_, c) =>
a[r].reduce((s,_,i) =>
s + a[r][i] * b[i][c], 0)));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment