Skip to content

Instantly share code, notes, and snippets.

@Jxck
Created September 19, 2011 08:18
Show Gist options
  • Save Jxck/1226145 to your computer and use it in GitHub Desktop.
Save Jxck/1226145 to your computer and use it in GitHub Desktop.
var hoge = {
num: 10,
twi: function(n, cb){
cb(n * 2);
},
add: function(a, cb){
this.twi(a, function(ans) {
cb(ans + this.num);
}.bind(this));
}
}
hoge.add(10, function(ans){
console.log(ans)
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment