Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

timoxley
Copy link
Member

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
Copy link
Member Author

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

@tj
Copy link
Member

tj commented Dec 17, 2012

+1 for .length()

@tj
Copy link
Member

tj commented Dec 17, 2012

this needs a rebase apparently

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants