I am learning javascript. I used 'this' as below in javascript
let person = {
name: 'Krishna',
age: 35,
sayHello() {
return 'Hello, my name is ' + this.name;
},
sayHi: () => `Hi ${this.name}`
};
console.log(person.sayHello());
console.log(person.sayHi());
sayHello() function is properly getting 'this' as person object. But in shorthand function sayHi(), this is referring to global window object. Here I am calling sayHi() with person object. But not sure why this is not getting referred to window object. Can any one please explain why this in sayHi() is not getting initialized with person object?