-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
1.9.0 regression. Calling first or last on an empty array returns undefined. #2741
Comments
Wow... It almost looks like this was an intended change... #2513 Personally, I think you would expect |
That does look like a nasty little regression to me — when called with the number of items specified explicitly. Any other opinions? @jridgewell? That said, it does raise the question of what |
Whoops, poor review on my part. Passing in a |
No worries, we can do a 1.9.1 with any other cleanups that arise — plus maybe settling some of the other open PRs... |
gracias. this one bit us too today. |
This one leads to very obscure bugs in edge cases in lots of various places in a bigger app in my case. Should it not be a priority? |
This one also bit us. Luckily it was caught by some unit tests before we rolled it out live. I'd be grateful for a quick fix. |
Alright! Underscore 1.9.1 is now published, with this bugfix in it. |
Thanks @jashkenas |
With 1.9.0
_.first([], 10)
returnsundefined
instead of[]
.I think this is a big problem 😛
The text was updated successfully, but these errors were encountered: