I have an array like this:
[[ 'Table', 'Column A', 'Column B', 'Column C'],
[ 'Row 1', 10, 5, 7 ],
[ 'Row 2', 20, 15, 50 ],
[ 'Row 3', 8, 13, 3 ]]
I would like to sort the columns, so the 'most important' column shows first, by sorting on the data in 'Row 1'. Result:
[[ 'Table', 'Column A', 'Column C', 'Column B'],
[ 'Row 1', 10, 7, 5 ],
[ 'Row 2', 20, 50, 12 ],
[ 'Row 3', 8, 3, 13 ]]
Notice how column C and B has changed position.
How can I do this in JavaScript
