이글이글
[4] React ES6 Array Methods 본문
Array Methods
JavaScript 배열 메서드는 다양한데 그 중 React에서 가장 유용한 방법 중 하나는 .map()배열 방식이다.
.map() 방법을 사용하면 배열의 각 항목에 함수를 실행하고 결과로 새 배열을 반환할 수 있다. 또한 map() 목록을 생성하는 데 사용이 가능하다.
const myArray = ['apple', 'banana', 'orange'];
const myList = myArray.map((item) => <p>{item}</p>)
'react' 카테고리의 다른 글
[6] React ES6 Spread Operator (0) | 2025.03.28 |
---|---|
[5]React ES6 Destructuring (0) | 2025.03.28 |
[3]ES6 Variables (0) | 2025.03.28 |
[2]React ES6 Classes (0) | 2025.03.17 |
[1] REACT ES6 (0) | 2025.03.17 |