The difference between call and apply bind

Same point:

1. They are all used to change the pointing of the this object of the function

2. The first parameter is the object to be pointed to by this

3. You can use subsequent parameters to pass parameters

difference:

Different ways of passing parameters: call is to pass parameters in order, and apply is to pass parameters in array/pseudo-array

The execution mechanism is different: call and apply will execute the function immediately, but bind will not execute the function immediately but get a new function that modifies this

Guess you like

Origin blog.csdn.net/Qiemo_/article/details/124853315