JavaScript Add Methods After Inheritance challenge

JavaScript Add Methods After Inheritance challenge
0

#1

The challenge doesn’t seem to be working anymore. Pressing “Run the Tests” gives no feedback.


Add Methods After Inheritance
#2

@mgh0, Already tried refreshing your browser?


#3

I’ve tried to complete the challenge from 2 different computers and with 3 different browsers (Mozilla, Chrome and Edge). The other challenges work just fine.

https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/object-oriented-programming/add-methods-after-inheritance


#4

I moved your question to a new topic, so you will get a better response. Please do not ask questions about your own solutions on another poster’s thread.

Also, you will need to copy/paste all of your code into a reply, so we can see what you have tried so far.

When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make easier to read.

Note: Backticks are not single quotes.

See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.


#5

Thank you! This is what i’ve tried, but it doesn’t really matter what I type, because I’m not getting any response from the page.


function Animal() { }
Animal.prototype.eat = function() { console.log("nom nom nom"); };

function Dog() { }

// Add your code below this line
Dog.prototype = Object.create(Animal.prototype);
Dog.prototype.constructor = Dog;
Dog.bark() = function() {
    console.log("Woof!");
}


// Add your code above this line

let beagle = new Dog();

beagle.eat(); // Should print "nom nom nom"
beagle.bark(); // Should print "Woof!"