title: how to output data one time in js
body: <p>I have an array and I want to output all even and odd elements under each other. They appear many times but I want to see them one time. I mean I need to press <code>enter</code> to see elements, but I do not need to do this. How can I solve that?</p>
  
  <p>my code:</p>
  
  <pre><code>var array = [1,2,3,4];
  for(var i=0; i&lt;array.length;i++) {
      if(array[i] % 2 == 0)
          alert(array[i]);
  }
  </code></pre>