10/30 There are some mistake in lesson definition : List ALL the Properties!


#1

I try this part in my code and that not works

`First, remember that:

dog.species = dog["species"] = "bulldog";

i mean : dog["species"]
my code works without those " " . Something like:

for(var fullName in nyc){
console.log(nyc[fullName]);
}

and does not work with " " :

for(var fullName in nyc){
console.log(nyc["fullName"]);
}

so..any explation?


#2

"" indicates that the object is a string, not a value. So by doing dog["species"], you are saying that dog has a string as a value. This causes a syntax error. Putting a value shows the value of the dog, which is species.

I'm guessing that you have already out a character with a property of species, so that's the explanation I'm giving you. :smiley:


#3

I understand what you try to say. thanks =) .
but in definition of lesson there is this part:
First, remember that:

dog.species = dog["species"] = "bulldog";

I mean : dog["species"]. why they say this?
I really hope you figure out what i'm trying to ask =)


#4

Yeah, I know what you're talking about. The example that says at the left side, right? Yeah, I have no idea why it's like that. Maybe they were trying to explain it better. :smiley: But you get it, right?


#5

Yes i get it,=) it was simple actually. thanks for your time anyway.=)