refactor: altera solucao maxValue #10

Closed
Rafael_Sampaio_de_Oliveira wants to merge 1 commits from refactor/solucao-maxValue into development

View File

@ -1,4 +1,12 @@
export function maxValue(values) {
// implementar logica aqui
}
var max = values.reduce(function (a, b) {
return Math.max(a, b);
}, -Infinity);
if (values.length === 0) {
return 0;
} else {
return max;
}
}