Last active
July 3, 2018 09:53
-
-
Save langjt/93138e0abb5684cd4c95 to your computer and use it in GitHub Desktop.
getPrototypeChain
This file contains 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 getPrototypeChain(object) { | |
var protoChain = []; | |
while (object = object.__proto__) { | |
protoChain.push(object); | |
} | |
protoChain.push(null); | |
return protoChain; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment