One of the functions in my codebase accepts a rest parameter.
function getByIds(...ids: string){
...
}
I have tested calling getByIds('andrew')
and getByIds('andrew','jackson')
, which successfully converts the strings into an array of strings.
Now, I am curious if it is possible to call getByIds(['andrew','jackson'])
when the parameters are already merged into an array.
In Java, this action would be valid, but I encountered issues with TypeScript and JsFiddle when attempting the same. Any insights on this matter would be appreciated.