callapply的使用.js var a = [1, 3, 4]function add(x, y, z){ this.push(x + y + z)}add.call(a, 1, 3, 4)console.log(a) // [1, 3, 4, 8]var b = [1, 3, 4]add.apply(a, b)console.log(a) // [1, 3, 4, 8]
var a = [1, 3, 4] function add(x, y, z){ this.push(x + y + z) } add.call(a, 1, 3, 4) console.log(a) // [1, 3, 4, 8] var b = [1, 3, 4] add.apply(a, b) console.log(a) // [1, 3, 4, 8]