call和apply的区别

2018-06-19  本文已影响5人  米诺zuo
var  numbers = [5, 458 , 120 , -215 ]; 
var  maxInNumbers = Math.max.apply(this, numbers);  
console.log(maxInNumbers);  // 458
var maxInNumbers = Math.max.call(this,5, 458 , 120 , -215); 
console.log(maxInNumbers);  // 458
上一篇下一篇

猜你喜欢

热点阅读