TS 定义函参剩余参数

index.ts

function foo(...rest: any[]) {
  console.log(rest)
}

foo(1, 2, 3) // [1, 2, 3]

posted on 2021-09-09 10:48  aisowe  阅读(284)  评论(0编辑  收藏  举报

导航