Home > front end >  Download you trouble consulting, format it is not allowed
Download you trouble consulting, format it is not allowed

Time:02-24

Class1 and class2 of the two methods both wrote this. SayMessage=function () {alert statement. This message, want to consult this format allows you


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,
  • Related