Guest User

Untitled

a guest
Dec 18th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. /*
  2. argumentsを本物の配列にする
  3. slice 配列を取り出す。引数が一個だとすべてを取り出す。
  4. */
  5. function func(arg1, arg2) {
  6. return Array.prototype.slice.apply(arguments);
  7. }
  8.  
  9. console.log(
  10. func(1,2,3,4)
  11. );
Add Comment
Please, Sign In to add comment