console.log([1,2,3,4].reduce((x,y) => { return x + y })) // 10
// Elements reduced to one value
console.log([1,2,3,4].map((x) => { return x + 5 })) // [6,7,8,9]
// Do something for each value and make a new array
console.log([1,2,3,4].filter((x) => { return x % 2 === 0 })) // [2,4]
// Filter the elements and make a new array
const array1 = [1, 2, 3, 4];
array1.forEach(x => { console.log(x)});
// For each loop.
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)