When you are inside a function invoked by a dom event, such as clicking a button, this refers to the element clicked. Or invoking a function that was created with a "bind" somewhere else in your codebase, you have no clue what this might equal. Yeah, so this keyword can be pretty confusing because its value can be so arbitrary at times. Thanks for the article!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
When you are inside a function invoked by a dom event, such as clicking a button, this refers to the element clicked. Or invoking a function that was created with a "bind" somewhere else in your codebase, you have no clue what this might equal. Yeah, so this keyword can be pretty confusing because its value can be so arbitrary at times. Thanks for the article!