Referencing an object in an array of objects in javascript
<pre><code>var Bar = function(){

}

Bar.prototype.drawBar = function(obj){ 

}

var bars = [];// Creating array 
for (i = 0;i &lt; ar.length ;i++){
    bars[i] = [new Bar(ar[i],i)]; // Creating array of objects
    bars[i].drawBar(i);// I am looking for something like this, Currently it doesn't work
}
</code></pre>

<p>I have something like this, How do I draw a bar, giving a reference/index, It should draw with the measurements</p>
