Skip to content

Instantly share code, notes, and snippets.

@gydoma
Last active October 6, 2022 13:00
Show Gist options
  • Save gydoma/cbe6d60f3edc036af9a59ccd7aca9f92 to your computer and use it in GitHub Desktop.
Save gydoma/cbe6d60f3edc036af9a59ccd7aca9f92 to your computer and use it in GitHub Desktop.
lista1 = new Array(10, -10, 20, 999, 30, -30);
var min = lista1[0];
function minimum(lista, min){
for(let i=0;i<lista.length; i++){
if (lista[i] < min){
min = lista[i];
}
}
console.log("min: "+min);
}
minimum(lista1, min);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment