0
var demo = { counter : 5 ,getCounter: () => this.counter};

console.log(demo.getCounter())

will print undefined;

how Can it print 5 without modifying the code(means by using arrow function only)

I tried apply,bind function But Nothing works

Aditya kumar
  • 159
  • 1
  • 7

0 Answers0