TypeScript——可变参数 发表于 2018-05-24 1234function peopleName (firstName:string, ...restOfname:string[]) { return firstName + ' ' + restOfname.join(' ');}var pn = peopleName("a", "b", "c", "d"); // "a b c d"