fix: ajuste em teste de numeros negativos

This commit is contained in:
Caroline Moran 2022-08-11 08:49:13 -04:00
parent da382aab6c
commit 66ffe9f4e4
2 changed files with 19 additions and 22 deletions

View File

@ -1,31 +1,28 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
</head>
<body>
<script>
/*
/*
Faça um algoritmo que retorne o maior numero encontrado no array
*/
function maxValue(values) {
// implementar logica aqui
return 0
}
// Resultados esperados
console.log(maxValue([4,6,12,5]), 12) // 12
console.log(maxValue([9, 234, 312, 999, 21 , 2311]), 2311) // 2311
console.log(maxValue([533, 234, 23423, 32, 432]), 23423) // 23423
console.log(maxValue([5, 4, 3, 2, 1]), 5) // 5
function maxValue(values) {
// implementar logica aqui
return 0;
}
// Resultados esperados
console.log(maxValue([4, 6, 12, 5]), 12); // 12
console.log(maxValue([9, 234, 312, 999, 21, 2311]), 2311); // 2311
console.log(maxValue([533, 234, 23423, 32, 432]), 23423); // 23423
console.log(maxValue([5, 4, 3, 2, 1]), 5); // 5
console.log(maxValue([-1, -5, -10, -45]), -1); // -1
</script>
</body>
</body>
</html>