Combine 2 arrays into a multidimensional array?
<p>This is based on my last question. </p>

<p>I have these arrays:</p>

<pre><code>var array1 = new Array ("Pepsi", "Coke", "Juice", "Water");
var array2 = new Array ("35",    "17",   "21",    "99");
</code></pre>

<p>And I want to combine them to form a multidimensional array like this: </p>

<pre><code>[
    ["Pepsi","35"]
    ["Coke", "17"]
    ["Juice","21"]
    ["Water","99"]
]
</code></pre>

<p>I tried this script:</p>

<pre><code>Values=[];

for (i = 0; i &lt; array1.length; i++) {
    Values[i] = Array(array1[i], array2[i]);
}
</code></pre>

<p>But it gave a result like this (correct values, incorrect names):</p>

<pre><code>[
    ["a","35"]
    ["c","17"]
    ["E","21"]
    ["I","99"]
]
</code></pre>
