Compare commits

..

No commits in common. "2ad74832503a9964f4cff21fb339e07c034188a0" and "e6874571ca249a841ccff98c01422720c5c39e00" have entirely different histories.

1 changed files with 11 additions and 11 deletions

22
app.js
View File

@ -1,11 +1,11 @@
let person1 = { let message = {
name: 'Mary', name: 'John',
getName: function(){ regularFunction: function() {
return this.name; console.log(this)
} console.log('Hello ' + this.name);
}; },
let person2 = { arrowFunction: () => console.log(this)
name: 'John' }
};
let getNameCopy = person1.getName.bind(person2); // won't change context of function message.regularFunction();
console.log(getNameCopy()); message.arrowFunction(); //