Created
December 5, 2012 10:56
-
-
Save Sandrucola/4214675 to your computer and use it in GitHub Desktop.
Encontrar un número en un array
This file contains hidden or 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
var a = new Array(); | |
num=50; | |
for(var i=0;i<=num;i++){ | |
a[i]=i; | |
} | |
a[12] = 29; | |
a[31] = 2; | |
function check(num){ | |
for ( i=0; i<=num;i++){ | |
if (a[i]==num) | |
return i; | |
} | |
} | |
// Realizado en equipo con Laura Castro |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment