let data2 = {
address: 'New Delhi ',
pin: '201206',
details: () => {
return this.address + " " + this.pin
}
}
Here, when I call data2.details()
, so output is undefined, but when using the es5 pattern,
let data2 = {
address: 'New Delhi ',
pin: '201206',
details: function () {
return this.address + " " + this.pin
}
}
it’s working properly?