Skip to content

Instantly share code, notes, and snippets.

@qetr1ck-op
Created September 28, 2015 21:00
Show Gist options
  • Select an option

  • Save qetr1ck-op/02ee2ee811e78b50274c to your computer and use it in GitHub Desktop.

Select an option

Save qetr1ck-op/02ee2ee811e78b50274c to your computer and use it in GitHub Desktop.
function Animal() { };
var animal = new Animal();
/*
creates automatically
Animal.prototype = {
constructor: Animal
}
*/
console.log(animal.constructor == Animal) //true
console.log(animal.hasOwnProperty('constructor')) // false
console.log(Animal.hasOwnProperty('constructor')) // true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment