•  
     

Exibir apenas strings - JavaScript

Código: Selecionar todos

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

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


Hello!
Bonjour!
Hola!