1
JavaScriptBeginner#arrays
forEach runs a callback for side effects and returns undefined, so it cannot be chained. map returns a new array of results and should not be used purely for side effects.
const out = [1,2].forEach(x => x*2); // undefined const arr = [1,2].map(x => x*2); // [2,4]