title: Javascript Map Array Last Item
body: <p>I have this:</p>
  
  <pre><code>map = ranks.map((row, r) =&gt; (
    row.map((rank, i) =&gt; {
      return [element(r, i, state, rank, toggled, onClick)];
    })
  ));
  </code></pre>
  
  <p>It maps through a 2-dimentional array.
  After each row, I'd like to insert <code>&lt;div class="clearfix"&gt;&lt;/div&gt;</code>.</p>
  
  <p>I think, if I could somehow get the last index for each row, so I will be able to use it in the row map callback. Can someone show me how to do it?</p>