DEV Community

Discussion on: Back to Basics: Understanding and Conquering "this" in Javascript

Collapse
 
tilkinsc profile image
Cody Tilkins

Try singletons instead.

SomeClass.Instance.SomeFunc()

Using 'This' should only boil down to extra specification on which fields you are modifying. You shouldn't have to use it outside the class and its available everywhere in the class. If you need multiple instances elsewhere, it's much better to consume an array of the data and pass around a reference to that.