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.
Asked
Active
Viewed 40 times
1

PRVS
- 1,612
- 4
- 38
- 75

Raquel Vieira
- 13
- 3
-
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 Answers
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?