Compare the "reduce" method with the "for" iteration method.
Use case:
There is an array with different numbers, we will compare the performance between the two methods to find the quantity of numbers greater than zero in the array list.
Comparing performance of: Number 1: use for iterator vs Number 2: using reduce method
Memory measurements supported only in Chrome.
For precise memory measurements Chrome must be launched with --enable-precise-memory-info flag.
More information: Monitoring JavaScript Memory
Test case name
Result
Number 1: use for iterator
Number 2: using reduce method
Fastest:N/A
Slowest:N/A
Latest run results:
Run details: (Test run date:
4 years ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Safari/605.1.15