refactor(maxValue): melhorando o código

This commit is contained in:
Victor Cardoso de Souza 2022-11-01 15:52:04 -03:00
parent 66051c8ddb
commit d1f05007e0

View File

@ -1,8 +1,8 @@
export function maxValue(values) {
let resultOfMaxValue = Math.max(...values)
if(values === null) {
resultOfMaxValue = 0
if(values.length === 0) {
return 0
}
return resultOfMaxValue