So I have this array:
[[21, "Bowling Ball"], [2, "Dirty Sock"], [1, "Hair Pin"], [5, "Microphone"]], [3, "Half-Eaten Apple"],[7, "Toothpaste"]];
I want to sort the element of this array in alphabetic order accordingly to the second element. So I wanted to be ordered like this:
[[21, "Bowling Ball"], [2, "Dirty Sock"], [1, "Hair Pin"], [3, "Half-Eaten Apple"], [5, "Microphone"]], [7, "Toothpaste"]];
What can I do to accomplish this in javascript?