makeArray generates 2-dimensional array when 1-dimensional would do

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....

  1. // The javascript that I'm given...
  2. var ay1 = new Object();
  3. ay1[0] = "ee";
  4. ay1[1] = "dd";

  1. // I convert into an array..
  2. ay2 = jQuery.makeArray(ay1);

  1. //A dump of ay2 reveals it is this...
  2. ay2[0][0]='ee';
  3. ay2[0][1]='dd';


  1. // Why did .makeArray not produce a 1-dimensional array like this..
  2. ay2[0]='ee';
  3. ay2[1]='dd';

Is this a bug or am I using .makeArray() incorrectly?
Thanks,
Don