Last active
October 6, 2022 13:00
-
-
Save gydoma/b1b8723b5079565dd4b3becee0a0f895 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lista2 = new Array(10, -10, 20, 999, 30, -30); | |
var max = lista2[0]; | |
function maximum(lista, max){ | |
for(let i=0;i<lista.length; i++){ | |
if (lista[i] > max){ | |
max = lista[i]; | |
} | |
} | |
console.log('max: '+max); | |
} | |
maximum(lista2, max); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment