typescript using ...args code example
Example: typescript set argument type
// non typed function
function add(x, y) {
return x + y;
}
// typed function
function add(x: number, y: number): number {
return x + y;
}
// types can be found here: https://www.typescriptlang.org/docs/handbook/basic-types.html