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:
Samuel Clay
2011-04-06 09:03:40 -04:00
parent 5457522582
commit 1fc7d4b049
3 changed files with 6 additions and 34 deletions

View File

@@ -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`.