Created
November 27, 2013 22:04
-
-
Save LeoNogueira/7684018 to your computer and use it in GitHub Desktop.
Function to list all object properties
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function listAllProperties(o){ | |
var objectToInspect; | |
var result = []; | |
for(objectToInspect = o; objectToInspect !== null; objectToInspect = Object.getPrototypeOf(objectToInspect)){ | |
console.log(Object.getOwnPropertyNames(objectToInspect)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment