Re:‘This’ in JavaScript
by kitd on Thursday August 03, 2017 @06:23AM
(#14918352)
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.
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.