For-In Loops with Objects


/ Published in: JavaScript
Save to your folder(s)

What this does is prints out every property within the object, rather than having to write the code for printing out each specific property.

In English, what is the code doing? It says: Assign the first property of the dog object to the variable property. Run the code (here, it is to print property to console). Then assign the second property of the dog object to the variable property. Again, run the code in the curly brackets. Keep repeating this until all the properties of the dog have been assigned to property.

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.