Is there a way how to pass array of arguments into typescript rest parameter, without changing implementation of Foo class ?
class Foo{
constructor(...restParam : string[]){}
}
class Test{
CallFoo = () => {
// Working
let foo = new Foo("t", "t");
// Compilation error
let restParamValues = ["t", "t"];
let foo2 = new Foo(restParamValues);
};
Error: Argument of type 'string[]' is not assignable to parameter of type 'string'.