DEV Community

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

jonosellier profile image

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)

kelvin0712 profile image
Kelvin Author

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 💪

myleftshoe profile image

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