What does the reduce() method do?
- A Reduces array length by removing elements
- B Executes a reducer function on each element to produce a single output value
- C Filters elements matching a condition
- D Sorts and shortens the array
Answer
Executes a reducer function on each element to produce a single output value
reduce accumulates a result across the array. Always pass an initial value, or reduce on an empty array throws a TypeError.





