title: React, using .map with index
body: <p>I have a simple React component like so:</p>
  <pre><code>import React from 'react';
  
  const ListPage = ({todos}) =&gt; (
    &lt;div&gt;
      &lt;h6&gt;todos&lt;/h6&gt;
      &lt;ul&gt;
      {todos.map(({todo, index}) =&gt; (
        &lt;li key={index}&gt;{todo}&lt;/li&gt;
      ))}
      &lt;/ul&gt;
    &lt;/div&gt;
  )
  
  ListPage.propTypes = {
    todos: React.PropTypes.array,
  };
  
  export default ListPage;
  </code></pre>
  <p>I can see that the docs for <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map" rel="noreferrer">Array.prototype.map()</a> shows that the second argument is index, next to currentValue. How does one alter the existing code to pick up the second argument?</p>