14/16

<PLEASE USE THIS TEMPLATE TO HELP YOU CREATE A GREAT POST!>
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?

<Below this line, add a link to the EXACT exercise that you are stuck at.>
https://www.codecademy.com/en/courses/react-101/lessons/react-jsx-advanced/exercises/jsx-keys

<Below this line, in what way does your code behave incorrectly? Include ALL error messages.>

```

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}
});

// ReactDOM.render goes here:
ReactDOM.render(

    {peopleLIs}
, document.getElementById(‘app’));
<do not remove the three backticks above>

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