Why does this associative array return undefined?
<p>I don't know why this isn't working. I thought I've seen this in use a dozen times but it appears that I looked at it the wrong way judging from this:</p>

<pre><code>var array = ["dog", "cat"];
console.log(array["dog"]); // undefined, why?
</code></pre>
