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

**URL:** <https://forum.code.org/t/u6-l9-build-a-playlist-why-removing-after-5-items/40034>\
**Category:** Unit and Lesson Discussion\
**Created:** [October 30, 2024, 2:12am UTC](https://forum.code.org/t/u6-l9-build-a-playlist-why-removing-after-5-items/40034 "2024-10-30T02:12:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dhust](https://avatars.discourse-cdn.com/v4/letter/d/ecc23a/32.png) [@dhust](https://forum.code.org/u/dhust)\
**Post date:** [October 30, 2024, 2:12am UTC](https://forum.code.org/t/u6-l9-build-a-playlist-why-removing-after-5-items/40034/1 "2024-10-30T02:12:59Z")

</div>

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()`](https://studio.code.org/docs/applab/removeItem/) function to remove the last entry in the `favorites` list.
> - Example: `removeItem(favorites, favorites.length - 1);`

---

<div class="post-metadata">

**Author:** ![madeline\_r\_burton](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/madeline_r_burton/32/5037_2.png) [@madeline\_r\_burton](https://forum.code.org/u/madeline_r_burton)\
**Post date:** [October 31, 2024, 1:18pm UTC](https://forum.code.org/t/u6-l9-build-a-playlist-why-removing-after-5-items/40034/2 "2024-10-31T13:18:34Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![demetere](https://avatars.discourse-cdn.com/v4/letter/d/3ab097/32.png) [@demetere](https://forum.code.org/u/demetere)\
**Post date:** [November 13, 2024, 5:41am UTC](https://forum.code.org/t/u6-l9-build-a-playlist-why-removing-after-5-items/40034/3 "2024-11-13T05:41:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![madeline\_r\_burton](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/madeline_r_burton/32/5037_2.png) [@madeline\_r\_burton](https://forum.code.org/u/madeline_r_burton)\
**Post date:** [November 14, 2024, 2:11am UTC](https://forum.code.org/t/u6-l9-build-a-playlist-why-removing-after-5-items/40034/4 "2024-11-14T02:11:19Z")

</div>

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!
