Rename fuse.Array#inject to a more standard name of reduce.
-
Joe Gornick
ES5 Spec Link: http://es5.github.com/#x15.4.4.21
-
Kit Goncharov
Agreed. I think the API for
Array#injectis more intuitive thanArray#reduce, but that's probably because I've used the former so often in Ruby. We can probably relegate the currentinjectimplementation to the Prototype emulation layer. -
Joe Gornick
Kit, I think you may have read this incorrectly. We are looking to rename inject -> reduce and follow the behavior as described in spec.
-
Kit Goncharov
Sorry, allow me to clarify. I know we want to rename
injecttoreduceand make it spec-compliant, but wouldn't we'd still need to implementinjectin the emulation layer? -
Joe Gornick
Oh, I get it now! Yes, you are correct about implementing a custom inject in the Prototype emulator.
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.