Skip to content

Instantly share code, notes, and snippets.

@massimilianop7
Created December 11, 2012 23:35
Show Gist options
  • Save massimilianop7/4263389 to your computer and use it in GitHub Desktop.
Save massimilianop7/4263389 to your computer and use it in GitHub Desktop.
Encontrar numero entre X y Y
function buscarDesdeHasta(desde,hasta,x)
{
var arr = new Array();
var longitud= hasta-desde+1;
for (var i=0; i<=longitud; i++)
{
if (desde<=hasta)
{
arr[i]=desde;
desde++;
};
};
for (var i = 0; i <= longitud; i++)
{
if (arr[i]==x)
{
return i;
};
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment