diff --git a/app.js b/app.js index 44269d2..5894996 100644 --- a/app.js +++ b/app.js @@ -1,7 +1,11 @@ -function introduction(name, profession) { - console.log('My name is ' + name + ' and I am a ' + profession + '.'); - console.log(this); -} -introduction('John', 'student'); -introduction.apply(undefined, ['Mary', 'Lawyer']); -introduction.call(undefined, 'James', 'artiest'); \ No newline at end of file +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()); \ No newline at end of file