Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

typescript class as function parameter

class A {}

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

let a = create(A); // a is instanceof A
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #typescript #class #function #parameter
ADD COMMENT
Topic
Name
5+5 =