Skip to content

Instantly share code, notes, and snippets.

@michael-mafi
Last active February 5, 2017 01:39
Show Gist options
  • Select an option

  • Save michael-mafi/3fbad3727b04e48382685005db810d43 to your computer and use it in GitHub Desktop.

Select an option

Save michael-mafi/3fbad3727b04e48382685005db810d43 to your computer and use it in GitHub Desktop.
isPrototypeOf2 function ๐Ÿพ
function isPrototypeOf(prototype, object){
if (prototype === null || undefined){
return 'null or undefined';
}
var objectPrototype = Object.getPrototypeOf(object);
while(objectPrototype){
if(prototype === objectPrototype){
return true;
}
objectPrototype = Object.getPrototypeOf(objectPrototype);
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment