Get key and value of a JavaScript array into variable
<p>I have a JavaScript object array. When write <code>console.log(myarry)</code> it will show in the console in the below form. </p>

<pre><code>Array[2]
0: Object
one: "one"

1: Object
two: "two"
length: 2
</code></pre>

<p>In this array my key and value are same and am trying to get the key or value to a variable and print it. When am trying the below code it showing:</p>

<blockquote>
  <p>object object</p>
</blockquote>

<pre><code>for (var key in myarry) {
 alert("Key is " + key + ", value is" + myarry[key]);
}
</code></pre>