| 12345678910111213141516171819202122 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>Document</title>
- </head>
- <body>
- <script>
- // ...变量名 rest
- function fn1(name,...age) {
- console.log(arguments)
- console.log(name,'name')
- console.log(age,'age')
- }
- fn1("图图",3,4,5,6)
- let [a,...x] = [1,2,3,4,5];
- console.log(a,'a')
- console.log(x,'x')
- </script>
- </body>
- </html>
|