JavaScript——prototype属性的apply方法和call方法

来源:互联网 发布:数据包怎么上传到淘宝 编辑:程序博客网 时间:2024/06/05 22:51
function box(num1,num2){  return num1+num2;}function callBox(num1,num2){//  return box.call(this,num1,num2);//和apply的区别在于后面的传参//  return box.apply(this,[num1,num2]);return box.apply(this,arguments);}alert(callBox(10,10));
0 0
原创粉丝点击