28. hello this is a dog. Advances, but won't print


Here's 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");

It advances, but does not print; however, it does print at https://repl.it/languages/.

Should I just keep going and not overthink it?

thanks in advance,



++++ reset of session *****************
As you are manipulating with objects
under certain circumstances you can shoot your Browser in an
inconsistent state.

Therefor it is of an advantage to know that you have 2 reset facilities:

One is the use of the F5-key which does a refresh Browser


Two, select&copy your code
Then use the Reset Code button of the course-window,
then paste your code back in.

General Notes:
Always refresh the browser after making corrections:
CTRL f5 ( if on Windows or Linux)
CMD r ( if on a MAC).
CTRL 0 to reset browser zoom


Thats my code :

It prints but doesn't allowed me to move on, I'm almost done :smirk:


When I remove "this" from "this.breed" then it allowed me to pass but doesn't print text in the compailer


//console should be exactly like this to work 100%, no need for refresch even:

console.log("Hello this is a" + " " + this.breed + " "+ "dog")


just add this,

("Hello this is a" + " " + this.breed + " "+ "dog")

you have syntax err


Thank you leonhard.wettengmx.n, for your general information about resetting and zoom


Just try this. It's working.

console.log("Hello this is a"+" "+this.breed+" "+"dog");


console.log("Hello this is a " + this.breed + " dog");

Make sure to input a space after a like this "a " and before dog like this " dog".