Prototype Practice. Can pass, but something is.. odd


I am able to pass the section with the code below, but I do not know why the console is not printing anything from the for loop (the loop passes the exercise by itself even though nothing is printing).

function Cat(name, breed) { = 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(){

// add code here to make the cats meow!
for (var i = Cat[0]; i < Cat.length; i++){
} // works (in the sense that it "passes" the section even with the items below removed), but nothing is printed to console when I try to print this way. Why? Same if I use for/in. 

cheshire.meow(); //works and logs to console
gary.meow(); //works and logs to console


Cat is an Object constructor (A function) not an Array or Object ?


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