0
result = [['Houston','TX', 84],['Austin','TX', 84],['Los Angeles','LA', 84]];

The above is my code:

I want to sort this array alphabetically based on two fields, State and City. The sorted array for above example should be: result = [['Los Angeles','LA', 84], ['Austin','TX', 84], ['Houston','TX', 84]];

Please suggest me a solution in JavaScript

Alexander Paes
  • 101
  • 4
  • 13
  • I'm unable to relate to that. Can I have the explanation in my case with the answer @Derek – Alexander Paes Jul 18 '15 at 07:41
  • Your question is fundamentally the same as the one mentioned: both are sorting an array with two fields. If you need help with other parts such as how to use the `.sort` function, you might want to reformulate your question. – Derek 朕會功夫 Jul 18 '15 at 07:46

0 Answers0