<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
</body>
<script type="text/javascript">
function pop(){
console.log(arguments)
return Array.prototype.pop.apply(arguments);
}
function shift(){
console.log(arguments)
return Array.prototype.shift.call(arguments);
}
console.log(pop('A', 'B'))
console.log('------------')
console.log(shift('C', 'D'))
//数组的方法,无需加obj
//无属性 直接使用 有属性 才有区别
</script>
</html>
apply-call 使用 [一] 数组作为参数 调用数组的方法
最新推荐文章于 2021-10-15 20:58:03 发布