typescript get class properties typescript get class name

The solution for “typescript get class properties typescript get class name” can be found here. The following code will assist you in solving the problem.

//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);class YourClass {}

const fooInst = new YourClass();

//get the classname:
console.log(fooInst.constructor.name); // YourClass
console.log(YourClass.name);

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

0
inline scripts encapsulated in