Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Getting all inherited property names of an object
const getAllInheritedPropNames = (obj) => {
let props = [];
do {
props = props.concat(Object.getOwnPropertyNames(obj));
} while (obj = Object.getPrototypeOf(obj));
return props;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.