Look for-in to Me


Hey guys, I'm in intro to objects 2 Lesson 27 "Look for-in to Me", and I'm having a hard time figuring out how to print out the string properties. This is my code...

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

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

Any help would be greatly appreciated and an extra thank you if you can explain your process.


A simple syntax error.
That second to last bracket, should be a closing bracket, not an opening bracket, because it's closing the else statement.

Though, without anything inside the else statement, there's really no point in having it there at all. I would just delete the

else {



You have an opening brace { at the end instead of a closing one }.


In line 10, inside the if parameters you must adress the variable as typeof languages[x] instead of just typeof x.
Had the same problems in this exercise.


for(var x in languages){
if(typeof languages[x]==="string"){

Use typeof as shown above.


in this way it works too, it's no necessary typeof method

for(var english in languages){

if(languages[english] != 4){


i know it's a trap xD