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

_.all has an unecessary backward-incompatible change #218

Closed
nickretallack opened this issue May 24, 2011 · 1 comment
Closed

_.all has an unecessary backward-incompatible change #218

nickretallack opened this issue May 24, 2011 · 1 comment
Labels

Comments

@nickretallack
Copy link

I updated my underscore.js file today and my project broke. After a bit of debugging, I found out it's because _.all now requires the iterator argument, instead of it being optional. What is the point of this?

If no iterator is provided, why not use the identity iterator automatically? That would preserve backward compatibility. Also, it would allow me to use _.all all over the place without having to repeat that identity function argument every time for the simple case of checking my list items for truthiness.

@jashkenas
Copy link
Owner

... because we need to stick close to the ES5 API -- and the ES5 API requires the iterator argument, I'm afraid. You can take a look at the github issues to see the discusccion about the change.

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

No branches or pull requests

2 participants