How do i print the value of all properties in an object in javascript?
08:02 14 Jul 2013

i want to use a for in oop to get the value of all the properties but do not know how. The tutorial i am following gives this example of how i can do it, but i dont understand it.

for(var x in dog) { console.log(dog[x]); }

var nyc = {
    fullName: "New York City",
    mayor: "Michael Bloomberg",
    population: 8000000,
    boroughs: 5
};

// write a for-in loop to print the value of nyc's properties
javascript