Created
December 26, 2017 05:48
-
-
Save PavanKu/8da517cf52c90c04491e5f88bde6b665 to your computer and use it in GitHub Desktop.
Example for this
This file contains hidden or 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
function multiply(p, q, callback) { | |
callback(p * q); | |
} | |
let user = { | |
a: 2, | |
b:3, | |
findMultiply: function() { | |
multiply(this.a, this.b, function(total) { | |
console.log(total); | |
console.log(this === window); | |
}) | |
} | |
} | |
user.findMultiply(); | |
//Prints 6 | |
//Prints true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment