2021-05-12 13:36:32 +10:00

7 lines
164 B
JavaScript

let person1 = {name: 'John', age: 22};
let person2 = {name: 'Mary', age: 26};
let sayHi = function() {
console.log('Hi, ' + this.name);
};
sayHi.call(person1);