function Test() {
this.a = 5;
const b = 0;
const getValue = () => console.log(this.a, b);
this.testMethod = () => {
const b = 10;
getValue();
};
}
const test = new Test();
test.testMethod(); // 5, 0
this.testMethod = function() {
const b = 10;
console.log(this.a); // undefined
getValue();
}.bind(window);