How to get a slice from “arguments”

后端 未结 7 1908
天命终不由人
天命终不由人 2020-12-01 09:10

All you know that arguments is a special object that holds all the arguments passed to the function.

And as long as it is not an array - you cannot use

7条回答
  •  既然无缘
    2020-12-01 09:13

    You can use the method [].slice.call(arguments, 1)

    [].slice will return you the slice function object and you can call it as the arguments and 1 are the parameters

提交回复
热议问题