challenge-algorithms-v2.0/03-maxValue/index.js
2022-11-02 10:14:05 -03:00

11 lines
362 B
JavaScript

export function maxValue(values) {
return Math.max.apply(null,values)
}
console.log(maxValue([4, 6, 12, 5])) //(12)
console.log(maxValue([9, 234, 312, 999, 21, 2311]))//(2311)
console.log(maxValue([533, 234, 23423, 32, 432])) //(23423)
console.log(maxValue([5, 4, 3, 2, 1]))//(5)
console.log(maxValue([-1, -5, -10, -45]))//(-1)
console.log(maxValue([]))//(0)