02. Objects πŸ‘©β€πŸŽ“πŸ‘¨β€πŸŽ“

πŸ—οΈ Log Customer’s Drink Order Using an Object

Implement the following user story:

  • As a coffee shop owner, I want to store data about my customer’s drink order in an object and log a message indicating whether the drink is ready or still in the queue.

Acceptance Criteria

  • It’s done when the customerOrder object has three properties that store the drink’s name, the number of sugars, and a Boolean indicating whether the order is ready.

  • It’s done when the drink name and the number of sugars is logged to the console.

  • It’s done when, if the order is ready, the message "Ready for pick-up" logs.

  • It’s done when, if the order is not ready, the message "Still in order queue" logs.

πŸ’‘ Hints

How can we use dot notation or bracket notation to access an object’s values?

πŸ† Bonus

If you have completed this activity, work through the following challenge to further your knowledge:

  • What is a for...in statement? How can you use it to iterate over an object’s properties?

Use Google or another search engine to research this.


βœ… Solutions

Solutions Click Here