How do you list all properties of an object?

Posted by Jennifer | Updated on

You can use the Object.getOwnPropertyNames() method which returns an array of all properties found directly in a given object. Let’s the usage of it in an example


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers