Typescript Rest Parametes you learned about functions and their parameters. TypeScript introduced rest parameters to accommodate n number of parameters easily.
When the number of parameters that a function will receive is not known or can vary, we can use rest parameters. In JavaScript, this is achieved with the "arguments" variable. However, with TypeScript, we can use the rest parameter denoted by ellipsis ....
We can pass zero or more arguments to the rest parameter. The compiler will create an array of arguments with the rest parameter name provided by us.
No comments:
Post a Comment