U6 L9 (Build a Playlist) - Why removing after 5 items?

Not sure why they are thinking the list could be bigger than 5. The add a favorite button disappears at 5. Am I missing something??

Remove the last item in the favorites list if the length is greater than or equal to 5

  • Within the conditional, use the removeItem() function to remove the last entry in the favorites list.
  • Example: removeItem(favorites, favorites.length - 1);

Hello,

IN CS Principles, U6 does not have a lesson 9. I am not able to find the lesson you are referring to. Might this be a different course? OR a different unit? Without more context I’m not sure I can give much direction!

I think they are asking about U6 L3 List Practice - one of the choices is Create a Playlist: Lesson 9 Milestone 8.

Ahh, I see it!

While the add favorite button disappears at 5, this only removes the sort of “add at next open space” feature. The “insert at number” feature still works, so a person could override an existing entry in the list. When a user inserts something at number 1, for example, it doesn’t override everything else. Instead, it should shift all the songs down one place, meaning that the last song will be the 6th item in the list. This song will then be dropped. I see that this is the intended function based on the teacher solution. However when I look at the app on level 1, this is not actually how the app acts. I have left a support ticket in hopes that it get updated so the student-facing exemplar shows this behavior as well!