27/30 Looks For-In To Me (Use the "continue" to pass '4'!)


#1
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'){
        console.log(languages[property]);
    } else {
        continue;
    }
}

Below the “else” statement, you may use the “continue” for passing the number type. While the JavaScript run this code, it will pass the “4” for running the next string


#2

Why would you even include else? It doesn’t add much value, in fact, it doesn’t add anything at all


#3

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