Rename fuse.Array#inject to a more standard name of reduce.
Reported by Joe Gornick | March 4th, 2011 @ 12:37 AM
The inject method behavior is very close to the standard Array method of reduce. We should rename this method to follow the standard name and behavior.
MDC Array#reduce: https://developer.mozilla.org/en/JavaScript/Reference/Global_Object...
Comments and changes to this ticket
-
Kit Goncharov March 4th, 2011 @ 11:43 PM
Agreed. I think the API for
Array#inject
is more intuitive thanArray#reduce
, but that's probably because I've used the former so often in Ruby. We can probably relegate the currentinject
implementation to the Prototype emulation layer. -
Joe Gornick March 4th, 2011 @ 11:52 PM
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 March 4th, 2011 @ 11:56 PM
Sorry, allow me to clarify. I know we want to rename
inject
toreduce
and make it spec-compliant, but wouldn't we'd still need to implementinject
in the emulation layer? -
Joe Gornick March 4th, 2011 @ 11:57 PM
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.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
JavaScript frameworks share similar features and functionality such as DOM manipulation, event registration, and CSS selector engines. FuseJS attempts to incorporate the strengths of these frameworks into one stable, efficient, and optimized core JavaScript framework.