I thought the output would be same in ()=>{} and function(){} but I got a different output.
With function(){}
var person = {}; person.name = 'egoing'; person.introduce = function(){ return 'My name is '+this.name; } document.write(person.introduce());
the output was
'My name is egoing'
But with ()=>{} function,
var person = {}; person.name = 'egoing'; person.introduce = person.introduce=()=>{ return 'My name is ' +this.name} document.write(person.introduce());
output was
'My name is '
Why is it differnt??