Skip to content

02.1 Mapping array to <li> #29

@cgobbet

Description

@cgobbet

Hi;

the exercise proposes us to tweak the function over the array below:
const animals = [ { label: 'Horse' }, { label: 'Turtle' }, { label: 'Elephan' }, { label: 'Monkey' } ];

but the video brings an answer for an different array:
const animals = ["Horse", "Turtle", "Elephant", "Monkey"];

The consequence is that the answer to the exercise given in the video

const animalsInHTML = animals.map((singleAnimal, i) => {
	return <li key={i}>{singleAnimal}</li>;
});

does not match as a right answer (check screenshot at https://i.imgur.com/eEEOvkC.png)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions