title: Python loop : idx for idx (rewrite to javascript)
body: <p>I am trying to re-write some Python code to Javascript.</p>
  
  <p>I can't figure out how to rewrite this part :</p>
  
  <pre><code>zone_indices = [[idx for idx, val in enumerate(classified) if zone + 1 == val] for zone in range(maxz)]
  </code></pre>
  
  <p><strong>idx for idx, val</strong> : what does it mean to put <strong>idx</strong> at the beginning ?</p>