Comparing array to var during iteration(cont.)
<p>So here's my problem.. Might just be tired but, I want counter to ++ only if number has not occurred in array.</p>

<p>Meaning during the 4 iterations, counter should ++ only on iteration 1,3,4</p>

<pre><code>var array = [], number, temp = [4,2,5,9], counter = 0;
for(var i = 0; i &lt;= 3; i += 1) {
    array.push(i);
    number = temp[i];
}
document.write(counter);
</code></pre>

<p>But I'm drawing a blank here... Help?</p>

<p>(No this isn't homework)</p>
