DEV Community

Discussion on: A super-easy way to determine 'this' in JavaScript

Collapse
 
jonosellier profile image
jonosellier

Awesome article. Only critique I'd make is that you forgot about the industry's best practice for determining this: Putting console.log(this) at the top of every function or method 😉

I joke but I've seen code like that before (commented out thankfully)

Collapse
 
kelvin0712 profile image
Kelvin

Lol, thank you for your comment. I absolutely agree that console.log(this) is the easiest way to determine this 😂 You don't even need to remember those rules.

But fundamentals will always be useful for us 💪

Collapse
 
myleftshoe profile image
myleftshoe

(Personally, I use a preprocessor to insert console.log(this) into every function)! Here, the exclamation mark means NOT