Created
July 10, 2012 20:14
-
-
Save mhcornejo/3085928 to your computer and use it in GitHub Desktop.
Imprimir los numeros del 1 al 1000 sin bucles o condiciones
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
var functions = { | |
a1: function (number, max) { return print(number + 1, max); }, | |
aNaN: function (number, max) { return null;} | |
}; | |
function print(number, max){ | |
document.write(number + '<br />'); | |
var left = max - number; | |
var index = left/left; | |
return functions['a' + index.toString()](number, max); | |
} | |
print(1, 1000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment