2021-08-18 21:00:43 +00:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
2022-08-11 12:49:13 +00:00
|
|
|
<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" />
|
2021-08-18 21:00:43 +00:00
|
|
|
<title>Document</title>
|
2022-08-11 12:49:13 +00:00
|
|
|
</head>
|
2021-08-18 21:00:43 +00:00
|
|
|
|
2022-08-11 12:49:13 +00:00
|
|
|
<body>
|
2021-08-18 21:00:43 +00:00
|
|
|
<script>
|
2022-08-11 12:49:13 +00:00
|
|
|
/*
|
2021-08-18 21:00:43 +00:00
|
|
|
Faça um algoritmo que retorne o maior numero encontrado no array
|
|
|
|
*/
|
2022-08-11 12:49:13 +00:00
|
|
|
function maxValue(values) {
|
|
|
|
// implementar logica aqui
|
|
|
|
return 0;
|
|
|
|
}
|
2021-08-18 21:00:43 +00:00
|
|
|
|
2022-08-11 12:49:13 +00:00
|
|
|
// 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
|
2021-08-18 21:00:43 +00:00
|
|
|
</script>
|
2022-08-11 12:49:13 +00:00
|
|
|
</body>
|
|
|
|
</html>
|