While I can follow the instructions for this exercise and pass the test, I do not understand one part of it. The instructions have you pass in an i parameter that then becomes part of each key as you loop through your array. I don't think this was explicitly stated, but after googling it seems as though the second parameter of the .map function is the index of the item in the array that is being returned, thus making each key unique. I'm just seeking confirmation that this is what is taking place?


var React = require('react');
var ReactDOM = require('react-dom');

var people = ['Rowe', 'Prevost', 'Gare'];

var peopleLIs = people.map(function(person, i){
  // return statement goes here:
return <li key={"person_" + i}>{person}</li>

// ReactDOM.render goes here:
ReactDOM.render(<ul>{peopleLIs}</ul>, document.getElementById('app'));


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.