各要素に対して副作用を実行する。戻り値はundefined
['a', 'b', 'c'].forEach((value, index) => { console.log(index, value); }); // breakやreturnで全体を中断できないことに注意
mapと違い新配列を作らない。途中でループを止めたい場合はfor...ofかsomeを使う。
map()
filter()
reduce()
find() / findIndex()
前の関数
次の関数
flat() / flatMap()