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