DEV/javascript
Javascript Map 간단 사용법
석봉
2022. 2. 25. 15:53
const arr = [1, 2, 3];
const result = arr.map((data) => {
// 데이터를 가공 후 return하여 사용
return data * 10;
});
// 결과적으로 원본을 사용하지 않고 개별적으로 새로운 객체를 사용함.
console.log(result);