TypeScript——可变参数

function peopleName (firstName:string, ...restOfname:string[]) {
  return firstName + ' ' + restOfname.join(' ');
}
var pn = peopleName("a", "b", "c", "d"); // "a b c d"

你可能感兴趣的:(TypeScript——可变参数)