We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d521014 commit e6243c9Copy full SHA for e6243c9
README.md
@@ -954,6 +954,34 @@
954
this._firstName = 'Panda';
955
```
956
957
+ - When saving a reference to `this` use `_this`.
958
+
959
+ ```javascript
960
+ // bad
961
+ function() {
962
+ var self = this;
963
+ return function() {
964
+ console.log(self);
965
+ };
966
+ }
967
968
969
970
+ var that = this;
971
972
+ console.log(that);
973
974
975
976
+ // good
977
978
+ var _this = this;
979
980
+ console.log(_this);
981
982
983
+ ```
984
985
- Name your functions. This is helpful for stack traces.
986
987
```javascript
0 commit comments