TS 定义函参剩余参数

index.ts

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

foo(1, 2, 3) // [1, 2, 3]
原文地址:https://www.cnblogs.com/aisowe/p/15246020.html