Skip to content

Instantly share code, notes, and snippets.

@bttmly
Created March 27, 2014 21:28
Show Gist options
  • Save bttmly/9819403 to your computer and use it in GitHub Desktop.
Save bttmly/9819403 to your computer and use it in GitHub Desktop.
Get the prototype chain of an object.
var prototypeChain = function( o ) {
prototypes = [];
while ( o = Object.getPrototypeOf( o ) ) {
prototypes.push( o )
}
return prototypes;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment