A rest parameter or variadic parameter is an optional parameter that goes on the end of a function.
In Typescript, they're called rest parameters. Many other languages call them variadic parameters instead.
For example:
// `inN` is a rest parameter
function concat(in1: string, in2: string, ...inN: string[]) {
return in1 + in2 + inN.reduce((acc, val) => acc + val);
}
We use rest parameters for user-supplied functional options.