Skip to content

Instantly share code, notes, and snippets.

@mhcornejo
mhcornejo / test.js
Created July 10, 2012 20:14
Imprimir los numeros del 1 al 1000 sin bucles o condiciones
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);
}