Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The reduce()
method of Iterator
instances is similar to Array.prototype.reduce
: it executes a user-supplied "reducer" callback function on each element produced by the iterator, passing in the return value from the calculation on the preceding element. The final result of running the reducer across all elements is a single value.