Get the name of an object's type

前端 未结 20 2271
忘掉有多难
忘掉有多难 2020-11-21 22:37

Is there a JavaScript equivalent of Java\'s class.getName()?

20条回答
  •  悲哀的现实
    2020-11-21 22:48

    You can use the instanceof operator to see if an object is an instance of another, but since there are no classes, you can't get a class name.

提交回复
热议问题