JavaScript - loop over properties in Object

1:  var nyc = {  
2:    fullName: "New York City",  
3:    mayor: "Bill de Blasio",  
4:    population: 8000000,  
5:    boroughs: 5  
6:  };  
7:  for(var property in nyc) {  
8:    console.log(property);    
9:  }  

No comments:

Post a Comment