04. Iteration πŸ‘©β€πŸŽ“πŸ‘¨β€πŸŽ“

πŸ—οΈ Iterate Over an Array to Log Messages to Console

Implement the following user story:

  • As a member of the class, I want to store a list of my classmates and use that list to create a greeting for each student on the list.

Acceptance Criteria

  • It’s done when the names of five classmates are stored in a single variable named students.

  • It’s done when the total number of elements in the students array is logged to the console.

  • It’s done when, using a for loop, the greeting “Great to see you, CLASSMATE_NAME!” logs to the console for each classmate’s name in the students array.

πŸ’‘ Hints

How can you access each element using the element’s index and the array name?

πŸ† Bonus

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

  • What’s a while loop?

Use Google or another search engine to research this.


βœ… Solutions

Solutions Click Here