11 lines
271 B
JavaScript
Raw Normal View History

export function maxValue(values) {
// implementar logica aqui
2022-10-28 17:40:31 -03:00
//Math.max.apply(null, values); outro método
if(values.length === 0) {
return 0
} else {
return Math.max(...values); // método spred, vai espelhar a array e vai retorna o maior valor
}
}