JS arrays - how to build an array
<pre><code>    var adList = new Array();
    adList[0]["img"] = 'http://www.gamer-source.com/image/media/screenshot/thumbnail/489.jpg';/*
    adList[0]["h3"] = 'Product title2';
    adList[0]["button"]["link"] = '#link-url';
    adList[0]["button"]["text"] = 'Buy now';
    adList[0]["h3"] = 'asdfasdfasdf';

    adList[1]["img"] = 'http://www.gamer-source.com/image/media/screenshot/thumbnail/489.jpg';
    adList[1]["h3"] = 'Product title2';
    adList[1]["button"]["link"] = '#link-url';
    adList[1]["button"]["text"] = 'Buy now';
    adList[1]["h3"] = 'asdfasdfasdf';
</code></pre>

<p>I'm getting an error <code>adList[0] is undefined</code>, can I not define arrays like this?  Do I have to specify <code>adList[0]</code> as an array before I assign variables to it?</p>
