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 248 views
1 answer 216 views
1 answer 198 views
1 answer 251 views
1 answer 241 views
...