Answers for "typescript class as function parameter"

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

Code answers related to "C"

Browse Popular Code Answers by Language