当前位置: 首页 > Web前端 > JavaScript

js的apply调用bindarguments

时间:2023-03-27 17:48:54 JavaScript

1.这里有一个链接可以帮助您理解基本概念:https://www.runoob.com/w3cnot...2。关于arguments通过arguments得到的所有参数是什么(自动把函数所有参数放在一个数组中)constfun=()=>{console.log(arguments)}fun(3,5,6,8)//[3,5,6,8]3.es6方法通过rest模式constfun=(first,two,...remaining)=>{console.log(first,two,remaining)}fun(3,5,6,8)//35[6,8]