challenge-algorithms-Ana-Ca.../03-max-value/index.html

31 lines
816 B
HTML
Raw Normal View History

2021-08-18 21:00:43 +00:00
<!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">
<title>Document</title>
</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
</script>
</body>
</html>