Getting IN-timate


#1

This code works and passes. I'm just wondering why does it print out all of the field names when I am only typing "fullname" in the lines of code to execute.
Thanks for the clarification.

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

for(var fullName in nyc) {
console.log(fullName);
}


#2

Because fullname is just the name of the counting variable and doesn't have influence on its content. What comes before in is meant to store the stringified versions of the keys of the thing that comes after in