simple question about difference between array.item(n) and array[n]?
<p>I have a question.
I was recently writing some javascript code in  dreamweaver and in it's code complete everytime i would deal with array of elements it will give me array.item(n) rather then array[n]</p>

<p>What is the difference between those two ?</p>

<p>Some example code:</p>

<pre><code>function hideAllSubMenu(){
    var submenu = document.getElementsByTagName("div");
    for(var i = 0; i &lt; submenu.length; i++)
    {
     if(submenu.item(i).className == "submenu_wrap")
      submenu.item(i).style.display = "none";
    }
}
</code></pre>

<p>However it can be writen in such maner as well</p>

<pre><code>function hideAllSubMenu(){
    var submenu = document.getElementsByTagName("div");
    for(var i = 0; i &lt; submenu.length; i++)
    {
     if(submenu.[i].className == "submenu_wrap")
      submenu.[i].style.display = "none";
    }
}
</code></pre>

<p>It is somewhat confusing for somebody like me who in his first steps on learning core javascript.
Can somebody explain to me what is a difference</p>
