Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

typescript get class properties

//Given the class A:
class A {
    constructor() {
        this.a1 = "";
        this.a2 = "";
    }
}

//you get the properties with:
let a = new A();
let array = return Object.getOwnPropertyNames(a);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #typescript #class #properties
ADD COMMENT
Topic
Name
2+1 =