I have the following array:
test = [["E","188","12314","87235"],["B","1803","12314","87235"],["C","1508","12314","87235"]]
I want to sort the whole array by the second value in the inner arrays (188,1803,1508). So this is what I want to have.
test = [["E","188","12314","87235"],["C","1508","12314","87235"],["B","1803","12314","87235"]]
What would be the most efficient way to achieve this? Do I need to write a sort to do it?
"1508","1803","188".["188", "1803", "1508"].sort # => ["1508", "1803", "188"].