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

πŸ— Log Welcome Messages to Console Using an Array

Implement the following user story:

  • As an instructor, I want to create a list of student names and be able to add and rename names.

Acceptance Criteria

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

  • It’s done when the message “Welcome to the class STUDENT_NAME” is logged using each element in the array.

  • It’s done when the first element in the array is replaced with the name of a new student.

  • It’s done when, after an if statement confirms that the first element in the array has been replaced, the message “REPLACED_NAME is in class” is logged.

πŸ’‘ Hints

What is the first index in an array: 0 or 1?

πŸ† Bonus

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

  • How could you use the array’s length property to access the last element in an array of any length?

Use Google or another search engine to research this.


βœ… Solutions

Solutions Click Here