How can I sort 2D array with JavaScript?
I want to be able to sort the first column and then after sort the second column, but without change the first sorted column.
I have:
arr = [[3, 2],
[1, 2],
[2, 2],
[2, 1],
[2, 3]]
I expect:
arr = [[1, 2],
[2, 1],
[2, 2],
[2, 3],
[3, 2]]
Thanks in advance!