title: Kotlin - Difference between "forEachIndexed" and "for in" loop
body: <p>I am confused on what are the advantages/disadvantages of each of these approaches (assuming I need to use both <code>index</code> and <code>product</code>):</p>
  
  <pre><code>products.forEachIndexed{ index, product -&gt;
      ...
  }
  
  for ((index, product) in products.withIndex()) {
      ...
  }
  </code></pre>
  
  <p><code>products</code> here is a simple collection.</p>
  
  <p>Is there any performance/best practice/etc argument to prefer one over the other?</p>