I have an array of javascript arrays, with each inner array being of equal length. I want to sort one of the inner arrays chronologically (its members are all numbers), and I want the other arrays to re-order in the same way. E.g.
we start with this:
[[2, 3, 1], ["deux", "trois", "un"], ["zwei", "drei", "eins"]]
and the result I want is:
[[1, 2, 3], ["un", "deux", "trois"], ["eins", "zwei", "drei"]]
I've tried different variations on the following, but had no luck:
arr.sort((a, b) => a[0] - b[0])
All I get back is exactly what I put in!