"create an object for each cat, we could just use this constructor with the properties already defined."


#1


https://www.codecademy.com/courses/spencer-sandbox/3/3?curriculum_id=506324b3a7dffd00020bf661


not really an error. but in the lesson it says "Why is this Cat constructor so cool? It means if we have many cats and wanted to create an object for each cat, we could just use this constructor with the properties already defined."

how exactly would i do this? is it just dog2.age = 12; or would i first have to make a new dog object. like dog2={}; then use that dog2.age ? and does this include nested objects?


#2

So here is the basic outline to your question that should help you create this. Basically, you need to create a function for dog with two "characteristics" inside of it. The technical word has left my brain lol Age would be one of those characteristics. So you are close in your thinking but not quite right.

function Dog(what1, what2) {
this.what1 = what1;
this.what2 = what2;
}


#3

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