15 lines
184 B
JavaScript
15 lines
184 B
JavaScript
export function maxValue(values) {
|
|
|
|
if (values.length === 0) {
|
|
return 0;
|
|
|
|
}
|
|
|
|
else {
|
|
let maxNumber = values.reduce((a, b) => Math.max(a, b))
|
|
|
|
return maxNumber;
|
|
}
|
|
|
|
}
|