I have a multidimensional array that behaves like a spreadsheet. First item it's a column header:
[
['A', 'B', 'C', 'D'],
[ 1 , 2 , 3 , 4 ],
[ 5 , 6 , 7 , 8 ],
[...]
]
Order of the "columns" is defined by another array:
['C', 'A', 'D', 'B']
Expected result is:
[
['C', 'A', 'D', 'B'],
[ 3 , 1 , 4 , 2 ],
[ 7 , 5 , 8 , 6 ],
[...]
]
Would .map, .splice and .indexOf be the best approach?
What about their performance on a 20k+ array?
Thanks!
.splice()be used? What are current performance results? See jQuery - Can threads/asynchronous be done?