For-in loop trouble


#1


https://www.codecademy.com/courses/objects-ii/5/1?curriculum_id=506324b3a7dffd00020bf661


Somehow the typeof notALanguage is a string, because when I hit the save and submit button, 4 is printed out too and this pops up:
Oops, try again. It looks like you printed 4 when you shouldn't have!

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

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


#2

Ok so it looks like you did something in your console.log that should have done also in your typeof statement... I think that is a big enough hint xD maybe too big.....


#3

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