Be careful with this, though. Javascript is a strange and complex language, and it’s not very amenable to static analysis.
Most of the time it’s “easy” to determine what this refers to, but sometimes it’s literally impossible, because it’s ambiguous. For example, it might be determined at runtime, and vary from one invocation of a function to another. A good IDE will hopefully say “I don’t know what this is”, when it doesn’t know. But on that boundary between known and unknowable, the IDE is liable to get confused (and who can blame it?), and this is exactly the sort of place in your code that bugs tend to crop up.
All that is to say, take what your IDE tells you with a grain of salt.
Be careful with this, though. Javascript is a strange and complex language, and it’s not very amenable to static analysis.
Most of the time it’s “easy” to determine what
this
refers to, but sometimes it’s literally impossible, because it’s ambiguous. For example, it might be determined at runtime, and vary from one invocation of a function to another. A good IDE will hopefully say “I don’t know whatthis
is”, when it doesn’t know. But on that boundary between known and unknowable, the IDE is liable to get confused (and who can blame it?), and this is exactly the sort of place in your code that bugs tend to crop up.All that is to say, take what your IDE tells you with a grain of salt.