Challenge: Practicing `pop` & `shift`
Aufgabe
Swipe to start coding
- Use the
popmethod to remove the last element of theitemsarray. - Use a
console.logstatement to print the array after usingpop, in the format:After pop: [ element1, element2, ... ]. - Use the
shiftmethod to remove the first element of the array. - Use a
console.logstatement to print the array after usingshift, in the format:After shift: [ element1, element2, ... ].
Note
The
pop()method should be used before using theshift()method.
Lösung
War alles klar?
Danke für Ihr Feedback!
Abschnitt 1. Kapitel 62
single
Fragen Sie AI
Fragen Sie AI
Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen
Großartig!
Completion Rate verbessert auf 1.33
Challenge: Practicing `pop` & `shift`
Swipe um das Menü anzuzeigen
Aufgabe
Swipe to start coding
- Use the
popmethod to remove the last element of theitemsarray. - Use a
console.logstatement to print the array after usingpop, in the format:After pop: [ element1, element2, ... ]. - Use the
shiftmethod to remove the first element of the array. - Use a
console.logstatement to print the array after usingshift, in the format:After shift: [ element1, element2, ... ].
Note
The
pop()method should be used before using theshift()method.
Lösung
War alles klar?
Danke für Ihr Feedback!
Abschnitt 1. Kapitel 62
single