What's wrong with my code?


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

// print hello in the 3 different languages
for(var property in languages){
    if(typeof languages.property === "string"){

Is there any problem in my code?
I can't find the problem of my code, the console just show nothing when I run this code.


the for in loop stores the properties as string in the loop iterator (property), so you have to use the associative array notation:



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