Looking to organize a 2D array based on two specific criteria:
[ [ "the,", 3 ], [ "who,", 3 ], [ "take,", 4 ], [ "over,", 4 ], [ "world,", 5 ] ]
Sort by number in ascending order
Then arrange alphabetically in descending order
The desired output is the who
word. Currently, the first step has been accomplished using the code below:
arraySorted = arrCom.sort((a, b) => a[1] - b[1] || a[0] - b[0]);