Created
March 24, 2014 18:29
-
-
Save sbstp/9746196 to your computer and use it in GitHub Desktop.
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 instanceof2(obj, ctor) { | |
var proto = obj.__proto__; | |
while (proto !== null) { | |
if (proto === ctor.prototype) { | |
return true; | |
} | |
proto = proto.__proto__; | |
} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment