27. Looks for-in to me




I am trying to get this done and looked at example from another thread, but this does not work.
It says: "Oops, try again. It looks like you didn't print Hello!" And in the black box it reads: "undefined undefined undefined". What is wrong with this?

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

// print hello in the 3 different languages
for (var key in languages) {
    if (typeof languages[key] === "string") {


Hey @mariamariiia it looks like you're using both [bracket]notation as well as dot.notation in your code..

Try using bracket[notation] within all parts of your for loop :smiley:

Let me know if you need further prompting :slight_smile:



I got it right now and it printed everything right, but why it has to be languages[key] and not languages.key?


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