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 underst
for (var property in obj){
console.log(property + ": " + obj[property]);
}
This should do the trick, what this does is loops through the "Properties" of the object and logs the values accordingly.
I suggest you to use variable name that has some meaning instead of x and y like:
for(var property in object){
console.log(object[property]);
}
for your object
for(var prop in nyc){
console.log(nyc[prop]);
}