... 运算符

... 可以将剩余部分赋值 展开数组对象的剩余项

<!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>

 

posted @ 2020-04-25 11:15  1点  阅读(132)  评论(0编辑  收藏  举报