Skip to content

Instantly share code, notes, and snippets.

@umamichi
Last active August 29, 2015 14:25
Show Gist options
  • Save umamichi/2b7b1b64494c4fc5023c to your computer and use it in GitHub Desktop.
Save umamichi/2b7b1b64494c4fc5023c to your computer and use it in GitHub Desktop.
Javascript Question
var i = 1;
function log(){
console.log(i);
i++;
if(i > 100){
return false;
}
log();
}
log();
var i = 1;
function log(){
console.log(i);
i++;
switch(i){
case 101: return false;
}
log();
}
log();
function log(i){
console.log(i);
switch(i+1){
case 101: return false;
}
log(i+1);
}
log(1);
(function log(i){
switch(i+1){
case 101: return false;
default : console.log(i+1);log(i+1);
}
})(1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment