makeArray generates 2-dimensional array when 1-dimensional would do
Hi, I have some PHP that generates some Javascript including the conversion of a PHP array into a javascript object. I need to use the javascript .shift() method on this object so I thought about using the $.makeArray utility. However it seems to add an extra dimension....
- // The javascript that I'm given...
- var ay1 = new Object();
- ay1[0] = "ee";
- ay1[1] = "dd";
- // I convert into an array..
- ay2 = jQuery.makeArray(ay1);
- //A dump of ay2 reveals it is this...
- ay2[0][0]='ee';
- ay2[0][1]='dd';
- // Why did .makeArray not produce a 1-dimensional array like this..
- ay2[0]='ee';
- ay2[1]='dd';
Is this a bug or am I using .makeArray() incorrectly?
Thanks,
Don