I know that bind returns a function, does not change the original function this, and does not execute immediately.
what I want to know is the usage scenario?
Why use bind instead of call and apply directly?
I know that bind returns a function, does not change the original function this, and does not execute immediately.
what I want to know is the usage scenario?
Why use bind instead of call and apply directly?
No one answered for a long time. I checked a lot and thought a lot. I'd better answer it myself.
The parameters ofcall and apply call functions are fixed, and bind can call again and pass parameters again, so you can use bind
when the scene needs to pass parameters multiple times.Previous: About the symbol table management of auto local variables in the process of C compilation?
Next: Does css animation in vuejs not trigger v-enter class problems?