It seems that this sentence is very reasonable if you use people as a mirror to know the gains and losses.
Demo 1:
If it is a global function, this is equivalent to the window object. Various properties or methods defined in the function can be accessed outside the function, provided that this function needs to be called. .
Demo 2:
If you use new to instantiate an object, this is not equal to the window object, this points to the instance of function a
Demo 4:
Whether it is directly referencing a function or instantiating a function, the closure returned This in the function all points to window
Demo 5:
in This is used in HTML and generally represents the element itself
< div onclick="test(this)" id="div">Click Me
Register events under IE and Firefox (Chrome), this points to the window and the element itself respectively
Click Me< /div>
The above is my summary of the different application scenarios of this in javascript. There may be other situations, and I will add them if I find them later.