React ES6 Array Methods


Array Methods

There are many JavaScript methods.

One of the most useful features in React is the way members alike .map().

The .map() method allows you to start a task on each item in the list, returning the same new members as a result.

In React, map() can be used to list.


Example

Generate a list of items from an array:

const myArray = ['apple', 'banana', 'orange'];
const myList = myArray.map((item) => <p>{item}</p>)