rest parameter

A final function parameter written ...args that collects all remaining arguments into an array.

In more detail

It must be the last parameter, and there can be only one. Typing it with a tuple, such as ...args: Parameters<F>, keeps each argument's type and position.

Example

return (...args: Parameters<F>): ReturnType<F> => fn(...args);

Related terms

Taught in

References