How to find hidden properties/methods in Javascript objects?

后端 未结 4 1100
难免孤独
难免孤独 2020-12-18 15:05

I would like to automatically determine all of the properties (including the hidden ones) in a given Javascript object, via a generalization of this function:



        
4条回答
  •  时光说笑
    2020-12-18 15:23

    Object.getOwnPropertyNames won't return "the hidden ones".
    Object.getOwnPropertyNames returns the names of non-inherited properties.

提交回复
热议问题