What does "array.length -1" mean in JavaScript?
<p>I know how to use the JavaScript for loops to cycle through arrays for example, but I still didn't understand what the <code>array.length -1</code> means, specifically the <code>-1</code> part.</p>

<p>When using a for loop over an array we have something like this:</p>

<pre><code>for (i = 0; i &lt; array.length; i++) {...}
</code></pre>

<p>But I've seen also something like this, sometimes:</p>

<pre><code>for (i = 0; i &lt; array.length - 1; i++) {...}
</code></pre>

<p>In the second case, why there is the "-1" in the array.length and what does it do? Also why sometimes there is and sometimes isn't it shown?</p>