Created
October 5, 2022 07:14
-
-
Save gydoma/e61167f8daceaa2d50c06b8664205488 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, -20, 30, -30, 50, 222); | |
var keres = 9007199254709999; | |
function kereses(lista, keres){ | |
let hely2 = 0; | |
while (hely2 < lista.lenght && lista[hely2] != keres) { | |
hely2++; | |
} | |
if (hely2<lista.lenght){ | |
console.log("Keresett szám indexe: "+ hely2); | |
} | |
else { | |
console.log("Nem található.") | |
} | |
} | |
kereses(lista2, keres); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment