✏️8.8 반복문을 파이프라인으로 바꾸기 (Replace Loop with Pipeline)
const names = [];
for (const i of input) {
if (i.job === "programmer")
names.push(i.name);
}const names = input
.filter(i => i.job === "programmer")
.map(i => i.name)
;🧷 배경
map
filter
🧷 절차
🧷 예시
Last updated