I want to sort an array like this:
var myArray = [
  ['red', 350],
  ['yellow', 20],
  ['green', 75],
  ['blue', 100]
];
In the order of the numbers. So the output should be:
var myArray = [
  ['red', 350],
  ['blue', 100],
  ['green', 75],
  ['yellow', 20]
];
I tried using .sort but I couldn't get it to work right. Thanks!
 
    