Answers for "receive a class as argument 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 "receive a class as argument typescript"

Code answers related to "C"

Browse Popular Code Answers by Language