Skip to content

Instantly share code, notes, and snippets.

@gydoma
Created October 5, 2022 07:14
Show Gist options
  • Save gydoma/526df5ea471cec05b0d0dad749d61de0 to your computer and use it in GitHub Desktop.
Save gydoma/526df5ea471cec05b0d0dad749d61de0 to your computer and use it in GitHub Desktop.
lista3 = new Array(10, -10, 20, -20, 30, -30, 50, 222);
var hely = 0;
var keres = 20;
function kival(lista, keres, hely){
for(let i=0;i<lista.length;i++){
if(lista[i] == keres){
hely = i
break
}
}
console.log("Keresett szám indexe: "+ hely);
}
kival(lista3, keres, hely);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment