I want to create a dynamic array of objects, and retrive them
<p>Here is my code:
I have two arrays[lab ,val] whose values are to be dynamicaly passed to object.
k is array to hold objects</p>

<pre><code>var lab = ["1","2","3",4];
var val = ["sa","ma","pa","da"];
var k = [];
for(var i=0; i&lt;4; i++)  {
   data[i] = {};             
   data[i].label = lab[i];
   data[i].value = val[i]; 
   k.push(data[i]) ;  
}

document.write(k.data[0]);  
document.write(" " + k.data[0] + "&lt;br /&gt;");
</code></pre>
