I'm sure I have an obvious error, but I can't find it


#1


https://www.codecademy.com/en/courses/objects-ii/5/1#


although I am not getting any error messages, nothing is coming up on the screen. I haven't done this in a while, so I'm sure i'm forgetting something. can someone help?


var languages = {
    english: "Hello!",
    french: "Bonjour!",
    notALanguage: 4,
    spanish: "Hola!"
};

// print hello in the 3 different languages
for (var x in languages) {
    if (typeof languages[property] == "string") {
        console.log (languages[property]);
    }
}


#2

Problem.
You're iterating using x but using key as property


#3

I can't find any errors except why is there one set of { } inside of another set.


#4

Can you tell about property ?

if (typeof languages[property] == "string") {
        console.log (languages[property])

as you're iterating using x...

for (var x in languages)

#5

I figured out the problem, no idea where "property" came from.


#6
```
for (var x in languages) {
if (typeof languages[x] == "string") {
console.log (languages[x]);
}
}
```

Ya ,Your code now might look like this!
:thumbsup:


#7

Haven't gotten that far yet.


#8

I should have blurred the code :relieved:


#9

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