javascript get type/instance name

后端 未结 5 1918
一个人的身影
一个人的身影 2021-02-07 01:06

Is there a reliable way of getting the instance of a JavaScript object?

For example, relying on the fake \'obj.getInstance()\' function.

var         


        
5条回答
  •  醉梦人生
    2021-02-07 01:36

    I had some trouble with this, the solution was:

    String(x.constructor) === String(T.Q.W.C)
    

提交回复
热议问题