I\'m working on a codecademy.com exercise where we use for-in statements to loop through an object and print hello in different languages by checking to see if the values of the
Here is the answer: (use typeof and then the object name followed by the var in your for statement and test whether it is equal to "string")
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[x] === "string"){
console.log(languages[x]);
}
else ;
}