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

Fix bug #2741 : modify _.first() and _.last() #2760

Closed
wants to merge 1 commit into from
Closed

Fix bug #2741 : modify _.first() and _.last() #2760

wants to merge 1 commit into from

Conversation

benjaminviaud
Copy link

Before '.first([])' return 'undefined'
Now '
.first([])' return []
Same thing for _.last()
And add tests

Before '_.first([])' function return 'undefined'
Now '_.first([])' function return []
Same thing for _.last()
And add tests
@coveralls
Copy link

coveralls commented May 26, 2018

Coverage Status

Coverage increased (+0.007%) to 97.017% when pulling 042f5fd on benjaminviaud:master into 3cd55ea on jashkenas:master.

@Zainking
Copy link

Your change is not rationale.

@jgonggrijp
Copy link
Collaborator

@benjaminviaud I'm sorry to say it but @Zainking is right. If the first element of an empty array would be that same array, it would be an array with length 1, so it wouldn't be empty.

@jgonggrijp
Copy link
Collaborator

Also, #2741 was already fixed.

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

Successfully merging this pull request may close these issues.

4 participants