1

I use class.getName() code in JAVA language to get the name of a object type. But how can I do that in javascript language? I can't find anything similar.

PRVS
  • 1,612
  • 4
  • 38
  • 75
  • there is a good answer to exactly this question (updated in 2016) http://stackoverflow.com/questions/332422/how-do-i-get-the-name-of-an-objects-type-in-javascript – tho-masn Feb 05 '16 at 22:30

1 Answers1

1

You can use typeof or instanceof.

For more info, you can check this more detailed answer : How to get a JavaScript object's class?

Community
  • 1
  • 1
Vinks
  • 156
  • 5