Challenge: Practicing `pop` & `shift`
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Β 5. ChapterΒ 7
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Awesome!
Completion rate improved to 1.35
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Β 5. ChapterΒ 7
single