the this point of the javascript browser

Call method function function Arrow function
Ordinary function thisPointing to windowobjects thisPointing to windowobjects
Function as an object method this Points to the object calling the method thisPointing to windowobjects
Constructor thisPoint to newcreate objects Arrow functions cannot be used as constructors
bind, apply, call this Point to the newly bound object thisKeep the original direction ( the this direction of the arrow function is fixed )

Guess you like

Origin blog.csdn.net/SJ1551/article/details/109294801