Skip to content

Instantly share code, notes, and snippets.

@heron2014
Created December 7, 2016 18:06

Revisions

  1. Anita renamed this gist Dec 7, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.txt → getAllInheritedPropNames.js
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    const getAllProps = (obj) => {
    const getAllInheritedPropNames = (obj) => {
    let props = [];
    do {
    props = props.concat(Object.getOwnPropertyNames(obj));
  2. Anita created this gist Dec 7, 2016.
    7 changes: 7 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    const getAllProps = (obj) => {
    let props = [];
    do {
    props = props.concat(Object.getOwnPropertyNames(obj));
    } while (obj = Object.getPrototypeOf(obj));
    return props;
    };