Skip to content

Instantly share code, notes, and snippets.

@k1LoW
Created July 17, 2009 00:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save k1LoW/148778 to your computer and use it in GitHub Desktop.
Save k1LoW/148778 to your computer and use it in GitHub Desktop.
var Hoge={
one:function (str){
setTimeout(function(){ console.log(str); },0);
return this;
},
two:function (str){
this.cancel_id = setTimeout(function(){ console.log(str);console.log(str); },0);
return this;
},
three:function(str){
setTimeout(function(){ console.log(str); },0);
clearTimeout(this.cancel_id);
return this;
}
};
Hoge.one('a').two('b').three('c');//>ac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment