What is the difference between call and apply?

前端 未结 24 2254
太阳男子
太阳男子 2020-11-21 07:12

What is the difference between using call and apply to invoke a function?

var func = function() {
  alert(\'hello!\');
};
         


        
24条回答
  •  暖寄归人
    2020-11-21 08:01

    Difference between these to methods are, how you want to pass the parameters.

    “A for array and C for comma” is a handy mnemonic.

提交回复
热议问题