Thursday, April 19, 2012

How to order an array of arrays by index in javascript

I'm trying to order an array of arrays by it's 2nd index, so if I have something like:



a[0][0] = #
a[0][1] = $
a[1][0] = x
a[1][1] = y
a[1][2] = z
a[2][0] = qaz
a[2][1] = qwerty


I get:



a[0][0] = #
a[1][0] = x
a[2][0] = qaz
a[0][1] = $
a[1][1] = y
a[2][1] = qwerty
a[1][2] = z


Thanks in advance!!





No comments:

Post a Comment