Can someone tell me why this code doesn't work? 10/20


#1
var nyc = {


fullName: "New York City",
mayor: "Bill de Blasio",
population: 8000000,
boroughs: 5
};

for (var property in nyc) {
var x ="property";
console.log(nyc[x]);
};


#2

Without running the code, i would say the problem is in this line:

var x ="property";

here you assign the string property to a variable called x. Shouldn't assign the variable property to x:

var x = property;

#3

Whoops, completely missed that. Thanks!