Created
April 15, 2019 17:24
-
-
Save sagar-more/9f176c13c4fb7594c057ce0a53c88668 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 args = process.argv.slice(2); | |
var hero = { | |
name: args[0], | |
getSecretIdentity: function (){ | |
return this.name; | |
} | |
}; | |
var stoleSecretIdentity = hero.getSecretIdentity.bind(hero); | |
console.log(stoleSecretIdentity()); | |
console.log(hero.getSecretIdentity()); | |
// node script.js bruce-wayne |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment