var languages = {
english: "Hello!",
french: "Bonjour!",
notALanguage: 4,
spanish: "Hola!"
};
for (var x in languages)
{
if(typeof(languages.x)=="string")
{
console.log(languages.x);
}
}
Output should be- Hello! Bonjour! Hola!
But there is nothing on the console screen. (There is no syntactical error so maybe there is some logical error)
P.S. It's 27/30 exercise on www.codecademy.com (Last chapter)