1234567891011121314151617181920212223 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>rest</title>
- </head>
- <body>
- <script>
- /**
- * ... 将数组转换逗号分隔
- */
- const aa = [1,2,3,4]
- function chun(){
- console.log(arguments)
- }
- chun(aa) //只有一个元素,是数组
- chun(...aa) //数组内部所有元素
- </script>
- </body>
- </html>
|