Answers for "Define the constructor property on the Dog prototype."

0

Define the constructor property on the Dog prototype.

function Dog(name) {
  this.name = name;
}
Dog.prototype = {
  constructor: Dog,
  numLegs: 4,
  eat: function() {
    console.log("nom nom nom");
  },
  describe: function() {
    console.log("My name is " + this.name);
  }
};
Posted by: Guest on August-04-2020

Code answers related to "Define the constructor property on the Dog prototype."

Code answers related to "Javascript"

Browse Popular Code Answers by Language