The variable crewnames iterates through the nested spaceship.crew object. This object has 4 nested objects which are represented by the crewnames variable in the loop. The .name and .degree keys are accessed inside the console.log and retrieve the values associated with those keys. For example: spaceship.crew[crewnames].name will retrieve the value associated with the name key. This is expressed in the left column of the console.log. Degree is retrieved in the same way but is placed in the right column in the console.log.
The variable crewnames is a little deceiving as these are not names, but titles or roles. We have a captain, a first officer, a medic and a translator, which make up those keys of the crew object. Because the loop is iterating over these with a variable (crewnames) we are forced to use associative array syntax (bracket notation) on them but can access their explicit properties (.name, .degree) with property (dot) notation.