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

#1506 Implement maxIfEmpty and minIfEmpty methods for collections #1512

Merged
merged 1 commit into from
Sep 22, 2018

Conversation

JavierGelatti
Copy link
Contributor

Implement maxIfEmpty and minIfEmpty methods for collections, such that:

[1, 3, 2].maxIfEmpty({ 99 })
            =>  Answers 3

[].maxIfEmpty({ 99 })
            =>  Answers 99

["a", "ab", "abc"].maxIfEmpty({ e => e.length() }, { "default" })
            => Answers "abc"

[].maxIfEmpty({ e => e.length() }, { "default" })
            => Answers "default"

(and analogous methods for minIfEmpty)

@ghost ghost assigned JavierGelatti Sep 22, 2018
@ghost ghost added the in progress label Sep 22, 2018
@fdodino
Copy link
Collaborator

fdodino commented Sep 22, 2018

Great first day performance!

@fdodino fdodino merged commit 5114da4 into dev Sep 22, 2018
@ghost ghost removed the in progress label Sep 22, 2018
@fdodino fdodino deleted the fix-#1506-create-max-and-min-if-empty-methods branch September 22, 2018 23:20
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