Opened 14 years ago
Closed 14 years ago
#4461 closed enhancement (fixed)
Propose to add dojo.reduce
Reported by: | guest | Owned by: | anonymous |
---|---|---|---|
Priority: | low | Milestone: | |
Component: | Core | Version: | 0.9 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
dojo.reduce will iterate the array, apply the callback function to each element and return a scalar value back. This function template is a good candidate for min/max/sum implementation.
A typical example is:
dojo.reduce([6,2,5,8,3], function(reduced, item) { return reduced < item ? reduced : item; });
the result is 2.
Attached is the diff of dojo/_base/array.js and dojo/tests/_base/array.js
Attachments (1)
Change History (3)
Changed 14 years ago by
Attachment: | reduce.diff added |
---|
comment:1 Changed 14 years ago by
This may be a nice addition but it is useless to us without knowing who submitted it and whether or not they have a CLA on file. If whoever submitted could update this ticket with that information, we might consider it for inclusion to the codebase.
comment:2 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Closing with the checkin of dojox.lang.functional.
Note: See
TracTickets for help on using
tickets.
Diff of dojo.reduce, src and test case.