javascript · Javascript Basics
What is the purpose of the 'reduce' method in JavaScript?
Answers
- To reduce the size of an array
- To execute a reducer function on each element of the array, resulting in a single output value
- To filter out elements from an array
- To count the number of elements in an array