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



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]);


You're iterating using x but using key as property


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


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)


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

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

Ya ,Your code now might look like this!


Haven't gotten that far yet.


I should have blurred the code :relieved:


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