SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: Sort 2D Arrray

  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2010
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Sort 2D Arrray

    I check the web and they only show you how to sort the whole array. I would like to be able to sort the subset of the 2D array. Here's my array.

    Code:
    var myArray=new Array(
    new Array("af","ad","az","ab"),
    new Array("bc","bd","bg","bb","bx"),
    new Array("cf","ck","ca","cv","co"),
    new Array("dd"));
    How would I sort the sub array independently. So only the a's together, then only the b's together, etc.

    thanks

  2. #2
    SitePoint Addict goldensona's Avatar
    Join Date
    Jun 2011
    Posts
    226
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    take a look into this link

    JavaScript Sorting


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •