Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Object JavaScript - New Dog
var spot = new Cat("Spot");
// Cat.prototype is the prototype of spot
// spot inherits the constructor property from Cat.prototype
console.log(spot.constructor == Cat.prototype.constructor);
console.log(spot.constructor == Cat);
// But constructor property doesn’t belong to spot. The line below displays "false"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment