challenge-algorithms-v2.0-v.../03-maxValue/index.js

9 lines
166 B
JavaScript
Raw Normal View History

export function maxValue(values) {
let resultOfMaxValue = Math.max(...values)
if(values === null) {
resultOfMaxValue = 0
}
return resultOfMaxValue
}