184.108.40.206 Array.prototype.reduce ( callbackfn [ , initialValue [ , thisArg ] ] )
edilee at mozilla.com
Sat Mar 21 00:48:19 PDT 2009
Right now .reduce doesn't take an optional thisArg, so the callback
is always called with |null| for |this| per 9.c.ii.
The Array prototype object take an optional thisArg for every, some,
forEach, map, and filter; so it would be good to make reduce
consistent with the rest.
The new parameter list for Array.prototype.reduce would then be..
220.127.116.11 Array.prototype.reduce ( callbackfn [ , initialValue [ ,
thisArg ] ] )
Insert after step 4:
#. If thisArg was supplied, let T be thisArg; else let T be undefined.
For step 9.c.ii, replace:
"callbackfn with null as the this value" with..
"callbackfn with T as the this value"
Similarly, this should be applied to reduceRight as well:
18.104.22.168 Array.prototype.reduceRight ( callbackfn [ , initialValue [
, thisArg ] ] )
The only remaining Array callback is sort, which could be updated as well:
22.214.171.124 Array.prototype.sort ( comparefn [, thisArg ] )
More information about the Es-discuss