The preface
If you’re learning JavaScript, you might wonder what “this” means and why you need to bind sometimes and sometimes you don’t. Here are a few brief examples to help you sort things out.
What exactly does this mean?
1. This ==> is the name of a normal function.
2. Arrow function this ==> this is who in the environment (unchanged: current scope)
Here’s another example: inside document
2. Bind in functions
1. Specify the value of this directly in the function to prevent changes
If you specify an event to execute a function that changes this in the class, you can use bind without having to apply a layer of methods.
Directly bind the value of this at runtime.