enumerable icon indicating copy to clipboard operation
enumerable copied to clipboard

count(): simply return total number of items if no function supplied.

Open timoxley opened this issue 13 years ago • 3 comments

As far as I can tell, there's no way to access the length of the enumerable's data via the enumerable interface without invoking __iterator__.length, or doing .count(function(){return true}). This grants access to the length via calling count() without a function argument, e.g.

var arr = Enumerable([1,2,3,4,5]);
arr.count().should.equal(5);

timoxley avatar Dec 16 '12 12:12 timoxley

Possible should also add a length() method or something.

timoxley avatar Dec 17 '12 07:12 timoxley

+1 for .length()

tj avatar Dec 17 '12 23:12 tj

this needs a rebase apparently

tj avatar Dec 17 '12 23:12 tj