title: How to stop index count increment using Array.map iteration based on certain condition inside loop?
body: <p>like for e.g.</p>
  
  <pre><code>Array.map((obj, index) =&gt; (
      condition === true ? 
      default index counter increment
      : do not increase index count
  ))
  </code></pre>
  
  <p>I want my counter to increase only if my condition is true, is there any work around for this? I am facing problems when I like adding alternate colors to rows based on object and in case I want to reject certain objects and don't create any rows, even though the row doesn't create, still my counter increases, colors apply on the row which is actually not there and produces UI flaw.</p>