Skip to content

Instantly share code, notes, and snippets.

@gydoma
Last active October 6, 2022 13:00
Show Gist options
  • Save gydoma/b1b8723b5079565dd4b3becee0a0f895 to your computer and use it in GitHub Desktop.
Save gydoma/b1b8723b5079565dd4b3becee0a0f895 to your computer and use it in GitHub Desktop.
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