Code seems to be correct, but doesn't log anything to the console


#1


https://www.codecademy.com/courses/objects-ii/2/5?curriculum_id=506324b3a7dffd00020bf661#


There is no error message and Codecademy would let me pass although the code doesn't print anything to the console.
Could anybody explain where my error is? Thanks in advance.


function Cat(name, breed) {
    this.name = name;
    this.breed = breed;
}

// let's make some cats!
var cheshire = new Cat("Cheshire Cat", "British Shorthair");
var gary = new Cat("Gary", "Domestic Shorthair");

// add a method "meow" to the Cat class that will allow
// all cats to print "Meow!" to the console
Cat.prototype.meow = function() {
    console.log("Meow!");
};

// add code here to make the cats meow!
cheshire.meow;
gary.meow;


#2

I just tried your code and it works for me. maybe try to reload the page / reset code?


#3

Works now. Thanks a lot :slight_smile:


#4

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