multidimensional array

How do I create a multidimensional array that allows me to add as many values as I want?

I have defined one but I don't think it will allow me to add many more.
var dataValues = [           
      [null, 0,0, 0,0, null,null, 0, 0,null, 0,0] 
     ];

Open in new window


Any thoughts?
LVL 5
IsaacSharePoint Client Side DeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

leakim971PluritechnicianCommented:
var dataValues = [ [null, 0,0, 0,0, null,null, 0, 0,null, 0,0] ];
dataValues[0].push(123);
// now you've : [ [null, 0,0, 0,0, null,null, 0, 0,null, 0,0, 123] ]
dataValues.push([123, 456,789]);
//  now you've : [ [null, 0,0, 0,0, null,null, 0, 0,null, 0,0, 123], [123, 456,789] ]
0
IsaacSharePoint Client Side DeveloperAuthor Commented:
Can I just do the following also?

var dataValues[[]];
dataValues.push['8/21/2013',111111,22222,3333,44444,true,x,5555,6666,true,7777,8888];

I want to have several of the push() done dynamically.

I need it for my google charts when I will eventually do this...

    $.each(dataValues, function (index, value) {																			
		data.addRow(dataValues[index]);
    });

Open in new window

0
leakim971PluritechnicianCommented:
var dataValues = [ [ ] ];
var what_you_want = ['8/21/2013',111111,22222,3333,44444,true,x,5555,6666,true,7777,8888];
dataValues.push( what_you_want );
// now you 've : [ [ ],  ['8/21/2013',111111,22222,3333,44444,true,x,5555,6666,true,7777,8888] ]

Open in new window


So :

 $.each(dataValues, function (index, value) {																			
		data.addRow(dataValues[index]); // will loop two time from the previous, one with the empty array ( because []), and one with the big array ( because what_you_want )
    });

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
leakim971PluritechnicianCommented:
0
IsaacSharePoint Client Side DeveloperAuthor Commented:
Thanks!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.