📜  typescript 获取类属性 - TypeScript 代码示例

📅  最后修改于: 2022-03-11 14:48:26.131000             🧑  作者: Mango

代码示例1
//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);