-
Notifications
You must be signed in to change notification settings - Fork 14
Add max and min utils #19
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
Conversation
dictor93
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small comments. The rest LGTM!
src/max.js
Outdated
|
|
||
| const determineExtremumValue = require('./util/determineExtremumValue') | ||
|
|
||
| const min = (array) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| const min = (array) => { | |
| const max = (array) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indeed, thanks for typo detection
src/max.js
Outdated
| ) | ||
| } | ||
|
|
||
| module.exports = min |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| module.exports = min | |
| module.exports = max |
|
|
||
| return array.reduce((prev, curr) => { | ||
| if (isNil(curr)) { | ||
| return prev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems, this condition is not covered by tests
dictor93
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
ezewer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good to me, please add a test for letters as to prove this also works for text
Description:
This PR adds
maxandminutilsNew features:
maxutilminutilPR status: