How to get property of a selected element

Hi @prasanta

Getting all the properties of a node, unfortunately, isn’t possible. The reason behind this is that Object.keys()
(and similar functions) only consider an object’s “own” properties (added directly to the object), but not the ones coming from the class (prototype, etc.).

Therefore, you could only manually create a script that returns the properties of a node by checking its type (and using the documentation), things like hasOwnProperty(), Object.keys() or JSON.stringify() unfortunately won’t work.

If you only need it for personal reference, I suggest using the documentation or (for autocompletion) the typescript definitions (see Adding autocompletion and linting in editors and IDEs) :wink: .

4 Likes