reduce & map & filter & every & some
reduce로 다 만들 수 있다. (map & filter) const oneTwoThree = [1, 2, 3]; let result = oneTwoThree.map((v) => { console.log(v); return v; }); // 콘솔에는 1, 2, 3이 찍힘 oneTwoThree; // [1, 2, 3] result; // [1, 2, 3] oneTwoThree === result; // false result = oneTwoThree.map((v) => { return v + 1; }); result; // [2, 3, 4] *** map => 규칙적인 배열만 반환할 수 있는게 아니라, 함수 안에 적어준대로 반환할 수 있기 때문에 자유도가 높다. result = oneTwoThree.ma..
2020. 1. 21.