Results 1 to 3 of 3

Thread: [RESOLVED] Jagged Array

  1. #1

    Thread Starter
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    25,689

    Resolved [RESOLVED] Jagged Array

    I have a global variable...

    Code:
    var myArray;
    var aString="1,2,3";
    I know i could populate myArray...

    Code:
    myArray=aString.split(",");
    But myArray should be an array of arrays. If i try this...

    Code:
    myArray[0]=aString.split(",");
    My javascript won't run. If i attempt to fix it by declaring
    Code:
    myArray=[];
    globally, it still won't run.

    What is the correct syntax for this?

  2. #2
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    4,738
    Last edited by Zvoni; Tomorrow at 31:69 PM.
    ----------------------------------------------------------------------------------------

    One System to rule them all, One Code to find them,
    One IDE to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    ---------------------------------------------------------------------------------
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    ---------------------------------------------------------------------------------
    Code is like a joke: If you have to explain it, it's bad

  3. #3

    Thread Starter
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    25,689

    Re: Jagged Array

    Quote Originally Posted by Zvoni View Post
    Thanks for the link, It was very helpful...

Posting Permissions

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



Click Here to Expand Forum to Full Width