Skip to content

Instantly share code, notes, and snippets.

@sbstp
Created March 24, 2014 18:29
Show Gist options
  • Save sbstp/9746196 to your computer and use it in GitHub Desktop.
Save sbstp/9746196 to your computer and use it in GitHub Desktop.
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