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);
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);
typescript get class name
class YourClass {}
const fooInst = new YourClass();
//get the classname:
console.log(fooInst.constructor.name); // YourClass
console.log(YourClass.name);
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us