Which is better, call or apply?

someone recently asked me a question: which is better, call or apply? Why?
I just knew how to use it before, and I didn"t think about it. I asked the great god to answer ~

.
Jul.11,2021

in fact, it doesn't matter which is better, but it is determined by the applicable scenario. Both of them have the effect of changing the direction of this. If you are an array of parameters, you have to use apply.


it seems that call has better performance


.

it is true that call was lost faster than apply in the early days, but now there is no difference between the two, and even if there is one, there is little difference between the two.

reference:

performance comparison of call and apply
is there a difference in performance between js call and apply?

Menu