9 lines
203 B
JavaScript
Raw Permalink Normal View History

export function maxValue(values) {
2022-11-02 16:27:33 -03:00
if (values.length == 0) return 0;
const maxValue = values.reduce(function (prev, current) {
return prev > current ? prev : current;
});
return maxValue;
}