/*
小例子
+ call 方法的作用: 伪数组借用数组方法
*/functionf(){
console.log(arguments)// 伪数组用不了数组常用方法// 但是数组可以// var res = arguments.every(function(t){ return t >= 20 }) // Uncaught TypeError: arguments.every is not a function// every() 方法的调用, 需要接收一个函数作为实参// arguments.every() 是因为 arguments 没有 every 方法, 所以报错// 空数组在调用 every 方法// every 里面的 this 指向前面的数组// 利用 call 方法来执行数组的 every 函数// 第一个参数是 every 里面的 this 指向// 原先 every 的 this 指向指向数组的时候, 遍历查看数组// 现在 every 的 this 指向 arguments, 遍历查看 arguments// call 的第二个参数是给函数传递参数的// 函数function(t){return t >= 20})就是传递给 every 方法里面的参数var res =[].every.call(arguments,function(item){return item >=8})
console.log(res)// true}f(10,20,30,40,50)