How to get the class name of an object in TypeScript

1 Answer

0 votes
class Programming {}
 
const instance = new Programming();
 
console.log(instance.constructor.name); 

console.log(instance.constructor); 

    
     
     
     
/*
run:
     
"Programming" 
class Programming {} 
     
*/

 



answered Jun 24, 2022 by avibootz

Related questions

1 answer 147 views
1 answer 130 views
1 answer 113 views
1 answer 161 views
1 answer 157 views
...