Skip to content

Instantly share code, notes, and snippets.

@nexpr
Created February 4, 2017 09:49
Show Gist options
  • Select an option

  • Save nexpr/37cb55e6ed26d9c8ec2325b5b4876a1a to your computer and use it in GitHub Desktop.

Select an option

Save nexpr/37cb55e6ed26d9c8ec2325b5b4876a1a to your computer and use it in GitHub Desktop.
show inherit of prototype
function showInherit(obj){
while(obj = obj.__proto__){
console.log(obj.constructor)
}
}
function showInheritFn(fn){
var obj = fn.prototype
do{
console.log(obj.constructor)
} while(obj = obj.__proto__)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment