Created
November 8, 2018 21:32
-
-
Save AminBusiness/6d2b0465c64c35f36475d04a40ba6722 to your computer and use it in GitHub Desktop.
// source https://jsbin.com/gavovuh
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
<script id="jsbin-javascript"> | |
//What is the output? | |
var hero = { | |
_name: 'Amin Elhasan', | |
getSecretIdentity: function() | |
{ | |
return this._name; | |
} | |
}; | |
var stoleSecretIdentity = hero.getSecretIdentity; | |
console.log(stoleSecretIdentity()); | |
console.log(hero.getSecretIdentity()); | |
</script> | |
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
//What is the output? | |
var hero = { | |
_name: 'Amin Elhasan', | |
getSecretIdentity: function() | |
{ | |
return this._name; | |
} | |
}; | |
var stoleSecretIdentity = hero.getSecretIdentity; | |
console.log(stoleSecretIdentity()); | |
console.log(hero.getSecretIdentity()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment