function log(){
console.log.apply(console,arguments)
}
演变 给输出的值加前缀
思路 :arguments为伪数组 转化成数组可以使用数组的方法 。
function log(){
let arr = Array.prototype.slice.call(araguments)
console.log.apply(console,arr)
}
function log(){
console.log.apply(console,arguments)
}
演变 给输出的值加前缀
思路 :arguments为伪数组 转化成数组可以使用数组的方法 。
function log(){
let arr = Array.prototype.slice.call(araguments)
console.log.apply(console,arr)
}