Answers for "class parameter typescript"

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 "class parameter typescript"

Code answers related to "C"

Browse Popular Code Answers by Language