26 for-in loops


#1


I have no idea what I did wrong.


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[key] = "string") {
        console.log(languages[key])
    }
}


#2

a single equal sign means assign, it doesn't check if something is equal


#3

it also says key is not defined, so i put x there?


#4

it worked that way thanks!


#5