mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-04 17:07:49 +00:00
Revert "Adding _.count to count truthy values in an iterator. _.count([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; }) = 3"
This reverts commit c8e3c04076.
Conflicts:
underscore.js
This commit is contained in:
@@ -164,16 +164,6 @@
|
||||
return results;
|
||||
};
|
||||
|
||||
// Returns a count of elements which pass a truth test.
|
||||
_.count = function(obj, iterator, context) {
|
||||
var count = 0;
|
||||
iterator || (iterator = _.identity);
|
||||
each(obj, function(value, index, list) {
|
||||
if (iterator.call(context, value, index, list)) count += 1;
|
||||
});
|
||||
return count;
|
||||
};
|
||||
|
||||
// Determine whether all of the elements match a truth test.
|
||||
// Delegates to **ECMAScript 5**'s native `every` if available.
|
||||
// Aliased as `all`.
|
||||
|
||||
Reference in New Issue
Block a user