O/P of Javascript code
<p>In the below JavaScript code :-</p>

<pre><code>var a  = [];
for (i in a) {
  alert(i);

}
</code></pre>

<p>I am getting o/p as - $family, $constuctor, each, clone, clean, invoke, associate, link, contains, append, getlast, getRandom, include, combine, erase, empty, flatten, pick, hexToRgb, rgbToHex.</p>

<p>Can anybody explain why is that so?Has it got to do something with properties of Array objects and if so then why aren't all the properties alerted? Also , if we take a empty object literal like var a = {} , we don't get any o/p.</p>

<p>Now , if I change the above code like :-</p>

<pre><code>var a  = [9,2];
for (i in a) {
    if (a.hasOwnProperty(i)) {
        alert(a.hasOwnProperty(i));
        alert(i);
      }
} 
</code></pre>

<p>I get the output as 0 and 1.Why is that so ? Are those the properties of this Array object (which are also the indexes) ?</p>
