Answers for "pass function into typescript class"

C
0

typescript class as function parameter

class A {}

function create(ctor: { new(): A }): A {
    return new ctor();
}

let a = create(A); // a is instanceof A
Posted by: Guest on September-17-2021

Code answers related to "pass function into typescript class"

Code answers related to "C"

Browse Popular Code Answers by Language