Skip to content

Instantly share code, notes, and snippets.

@eamodeorubio
Created August 31, 2011 10:05
Show Gist options
  • Save eamodeorubio/1183228 to your computer and use it in GitHub Desktop.
Save eamodeorubio/1183228 to your computer and use it in GitHub Desktop.
Autoejecutable cuenta 0 a 100 sin usar bucles, condicionales o expresiones booleanas
(function(max) {
var counter = 0
, theEnd = function() {
console.log(max);
}
, count = function() {
console.log(counter);
counter++;
countOperations[counter] = count;
countOperations[counter % max]();
}
, countOperations = [theEnd];
count();
})(100);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment