Hello? Yes, This is dog error


My code is correct and provides the correct output but it says it is incorrect.
Here is the code:

function Dog (breed) {
    this.breed = breed;

// add the sayHello method to the Dog class 
// so all dogs now can say hello
Dog.prototype.sayHello = function() {
  console.log("Hello, this is a " + this.breed + " dog");  

var yourDog = new Dog("golden retriever");

var myDog = new Dog("dachshund");

The outputs are:
Hello, this is a golden retriever dog
Hello, this is a dachshund dog

I don't see the problem, but this has happened before where they just want a different answer.


You have the wrong code for the exercise you are on.


What? the error message says:
Oops, try again. It appears that your sayHello method doesn't properly log to the console 'Hello this is a [breed] dog' where [breed] is the breed of the Dog

but my code obviously does it


Refresh zee browser and try again. zeeh code is correct.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.