Answer the question
In order to leave comments, you need to log in
How to properly describe the type of the rest parameter using array union?
Code example:
function func1(...args: string[] | number[]) {
//...
}
error TS2370: A rest parameter must be of an array type.
function func1(...args: (string | number)[]) {
//...
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question