... 运算符
... 可以将剩余部分赋值 展开数组对象的剩余项
<!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> </body> <script> let fn = (n, ...m) => { console.log(n, m) } fn(10, 20, 30, 40) </script> </html>
越努力越幸运