feat(03-maxvalue):completead third challenge

This commit is contained in:
Marcello Rodrigues Martins 2022-10-29 16:25:05 -03:00
parent c6f6df9c59
commit 82346e67ca

View File

@ -1,4 +1,14 @@
export function maxValue(values) { export function maxValue(values) {
// implementar logica aqui // implementar logica aqui
if (values.length == 0){
return 0;
}
return values.reduce((maiornum,atualnum) => {
if(maiornum > atualnum){
return maiornum;
}
else{
return atualnum;
}
})
} }