Created
May 19, 2012 04:30
-
-
Save kaneshin/2729113 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var foo = { | |
bar: 10, | |
baz: function(num, callback) { | |
callback(num * num); | |
}, | |
qux: function(num, callback) { | |
var self = this; | |
this.baz(num, function(res) { | |
callback(res + self.bar); | |
}); | |
} | |
}; | |
foo.qux(5, function(res) { | |
console.log(res); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment