Var message="hi";
The function class1 () {
This. The message="yeah";
Enclosing sayMessage=function () {
Alert (enclosing the message);
}
The function class2 () {
This. The message="hello";
Enclosing sayMessage=function () {
Alert (enclosing the message);
}
}
CodePudding user response:
Allow,I tend to use class1 () var _this=this; Class2 () var __this=this;
Increase the code readability,