Copy/paste error in Array.prototype.reduce

Geoffrey Sneddon gsneddon at
Wed Dec 9 07:52:01 PST 2009


In Array.prototype.reduce there exists the following text basically 
copy/pasted from Array.prototype.filter:

> The range of elements processed by reduce is set before the first
> call to callbackfn. Elements that are appended to the array after the
> call to reduce begins will not be visited by callbackfn. If existing
> elements of the array are changed, their value as passed to
> callbackfn will be the value at the time reduce visits them; elements
> that are deleted after the call to filter begins and before being
> visited are not visited.

"the call to filter" is wrong, it should refer to "the call to reduce". 
Array.prototype.reduceRight contains a similar typo.

Geoffrey Sneddon — Opera Software

More information about the es-discuss mailing list