SectionΒ 1. ChapterΒ 60
single
Challenge: Practicing `pop` & `shift`
Swipe to show menu
Task
Swipe to start coding
You are given an array named items:
["Apple", "Banana", "Orange", "Grape", "Mango"]
Your tasks:
- Use the
pop()method to remove the last element. - Then use the
shift()method to remove the first element. - Make sure
pop()is executed beforeshift(). - Return the updated array.
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 1. ChapterΒ 60
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat