Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialJonathan Healy
21,601 PointsAny particular reason the Employee Status is addressed prior to adding the Employee's Name to the loop?
Just peaking at the code, and wondering why since the employee's name is the first property listed in each object, it isnt added to the loop code prior to checking the state of the office status? Just curious if there is any particular reasoning behind this?
1 Answer
Christopher Ford
3,407 PointsHi Jonathan,
The order of the key:value pairs in an object don't really matter too much in the context of how you handle the data elsewhere. In this case, we need to check on the status of the room booking first as this will determine the class that is given to each <li>
, and then the name becomes a child of that tag.
In general, don't worry too much about the order of an object's properties, just access them in the most logical way when you want to make use of them in the wild.
I hope this helps, Chris