Cannot read property 'style' of undefined
<p>i have something like this, but i dont get where is the problem. Console says - <code>Cannot read property 'style' of undefined</code></p>

<pre><code>&lt;div class="price-table-box"&gt;&lt;/div&gt;
&lt;div class="price-table-box"&gt;&lt;/div&gt;
&lt;div class="price-table-box"&gt;&lt;/div&gt;
&lt;div class="price-table-box"&gt;&lt;/div&gt;

var table = document.getElementsByClassName('price-table-box');

for (var i = 0; i &lt;= table.length; i++) {
    table[i].style.display = 'none';
}
</code></pre>