17 ms·
Agreed. Much prefer 'var self = this' style. Keep the model transparent for future maintenance. One time I don't is in Jasmine, where they explicitly state tha
by kitd 9y ago
Agreed. Much prefer 'var self = this' style. Keep the model transparent for future maintenance.
One time I don't is in Jasmine, where they explicitly state that 'this' is shared across all 'beforeEach', 'it' and 'afterEach' calls. Which backs up your first point.
- nkozyra 9y agoI thought self had gone out of favor due to its relatively new global purpose.
- kitd 9y agook, call it something else. I meant to say, save away the current ref to 'this'.
- scruple 9y agoThis is where I've landed with the JavaScript that I write. It keeps things relatively sane, at least better than the other approaches I've tried.