Javascript - find the index corresponding to an array key
<p>Suppose there is a JavaScript array</p>

<pre><code>myArray = {
    "key1" : value1
    ...
    "keyn" : valuen
} 
</code></pre>

<p>My question is, can I find the integer index corresponding to, say, "key1" ? </p>

<p>I need both the value and the its integer position in the array!</p>
