Skip to content

Instantly share code, notes, and snippets.

@sagar-more
Created April 15, 2019 17:24
Show Gist options
  • Save sagar-more/9f176c13c4fb7594c057ce0a53c88668 to your computer and use it in GitHub Desktop.
Save sagar-more/9f176c13c4fb7594c057ce0a53c88668 to your computer and use it in GitHub Desktop.
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