title: how to return an object in a map function (React.js)
body: <p>I have some user input, I need to split them into characters, then just using map to return both the character array and index array as an object. Try many ways but all failed. Hope I can get some helps here. I am new to react.js and my code may sounds dum. The code is in App.js the main component.</p>
  <pre><code>  charList = () =&gt; { 
      this.state.userInputs.split(&quot;&quot;).map((ch1, index1) =&gt; 
      { return {ch: ch1, index: index1}
      } ); 
    }
  </code></pre>
  <p>I want to be able to access this.charList.ch and this.charList.index for the two arrays. Not sure I described my question clearly. Thanks in advance.</p>