//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);