Skip to content

Instantly share code, notes, and snippets.

@eamon0989
Last active July 26, 2021 13:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eamon0989/f872bbefc10fce247d47f09799df9a5f to your computer and use it in GitHub Desktop.
Save eamon0989/f872bbefc10fce247d47f09799df9a5f to your computer and use it in GitHub Desktop.
function Factory() {
this.foo = 1;
this.bar = 'string';
}
let descendant = new Factory();
console.log(Factory.prototype); // {}
console.log(Object.getPrototypeOf(Factory.prototype)); // [Object: null prototype] {}
console.log(
Object.getPrototypeOf(Factory.prototype) ===
Object.prototype); // true
console.log(Object.prototype.isPrototypeOf(Factory.prototype)); // true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment