“Oops, try again. Buddy should have a property named ‘species’ that is set to ‘golden retriever’” I don’t understand what’s my mistake please help. Thanks.
// help us make snoopy using literal notation
// Remember snoopy is a “beagle” and is 10 years old.
var snoopy = {
species: “beagle”,
age: 10
}
// help make buddy using constructor notation
// buddy is a “golden retriever” and is 5 years old
var buddy = new Object();
buddy.species = “golden retiever”;
buddy.age = 5;
Sorry! In this code I saw the mistake, but in my code I didn’t see. In literal notation there isn’t “;” in the end. But this is my code:
// help us make snoopy using literal notation
// Remember snoopy is a “beagle” and is 10 years old.
var snoopy = {
snoopy.species: “beagle”,
snoopy.age: “10”
};
// help make buddy using constructor notation
// buddy is a “golden retriever” and is 5 years old
var buddy = new Object();
buddy.species = “golden retriever”;
buddy.age = “5”;
I am ready. If someone need help, this is the correct code:
// help us make snoopy using literal notation
// Remember snoopy is a “beagle” and is 10 years old.
var snoopy = {
species: “beagle”,
age: 10
};
// help make buddy using constructor notation
// buddy is a “golden retriever” and is 5 years old
var buddy = new Object();
buddy.species = “golden retriever”;
buddy.age = 5;