@.
Size: a a a
@.
@.
@.
ᅠ
S🛸
AM
UT
class Test {
getVal() {
return 22;
}
checkMethod = () => {
console.log(this.getVal());
}
}
let tt = new Test();
let handler = tt.checkMethod;
handler();
A
UT
R
UT
R
UT
ᅠ
class Test {
getVal() {
return 22;
}
checkMethod = () => {
console.log(this.getVal());
}
}
let tt = new Test();
let handler = tt.checkMethod;
handler();
class Test {
getVal() {
return 22;
}
constructor(){
this.checkMethod = () => {
console.log(this.getVal());
}
}
}
Так понятнее тебе, что происходит?ᅠ
class Test {
getVal() {
return 22;
}
}
Test.prototype.checkMethod = () => {
console.log(this.getVal());
}
UT
class Test {
getVal() {
return 22;
}
constructor(){
this.checkMethod = () => {
console.log(this.getVal());
}
}
}
Так понятнее тебе, что происходит?UT
class Test {
getVal() {
return 22;
}
}
Test.prototype.checkMethod = () => {
console.log(this.getVal());
}
ᅠ
UT
class Test {
getVal() {
return 22;
}
checkMethod() {...}
}
ᅠ
let m = () => {
console.log(this.getVal());
}
class Test {
getVal() {
return 22;
}
checkMethod = m
}