function add(c,d){ return this.a + this.b + c + d; } var s = {a:1, b:2 }; console.log(add.call(s,3,4)); // 1+2+3+4 = 10 console.log(add.apply(s,[5,6])); // 1+2+5+6 = 14
关于call(),apply()
原文:https://www.cnblogs.com/sonsmart/p/15265684.html