property of an Object

Getting IN-timate
Let's now learn how to work with all the properties that belong to an
object. We introduce the for-in loop. Let's define some object

var dog = {
species: "bulldog",
age: 3,
color: brown
};
It is often useful to be able to run code on all the properties of an
object all at one time. As a simple example, let's say we want to print
out all the properties of the object dog. We could do this by printing
each property name individually, but that gets tedious if you have many
properties in the object.

This is where the for - in loop is useful. Below is the code which
would get the job done.

for(var property in dog) {
  console.log(property);
}
The words var and in are keywords. We need them to always be there. We
can replace dog with any object that we want the for-in loop to run
through. And you can think of property as a placeholder variable. You
can use any word you want here.

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.