2022-10-27 15:07:13 +00:00
|
|
|
export function maxValue(values) {
|
2022-11-02 13:14:05 +00:00
|
|
|
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)
|