练习题6_手动实现bind讲解.html 469 B

123456789101112131415161718192021
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>Document</title>
  7. </head>
  8. <body>
  9. <script>
  10. // var arr = [1,2,3,4,5,6,7,8,9];
  11. // console.log(arr.slice(1));
  12. function foo(){
  13. console.log(arguments);
  14. console.log(Array.prototype.slice.call(arguments,0))
  15. }
  16. foo(1,2,3,4,5,6)
  17. </script>
  18. </body>
  19. </html>