Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Apprendre Challenge: Practicing `pop` & `shift` | Exploring Arrays
Introduction to JavaScript

Glissez pour afficher le menu

book
Challenge: Practicing `pop` & `shift`

Tâche

Swipe to start coding

  • Use the pop method to remove the last element of the items array.
  • Use a console.log statement to print the array after using pop, in the format: After pop: [ element1, element2, ... ].
  • Use the shift method to remove the first element of the array.
  • Use a console.log statement to print the array after using shift, in the format: After shift: [ element1, element2, ... ].

Note

The pop() method should be used before using the shift() method.

Solution

Switch to desktopPassez à un bureau pour une pratique réelleContinuez d'où vous êtes en utilisant l'une des options ci-dessous
Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 5. Chapitre 7

Demandez à l'IA

expand
ChatGPT

Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion

book
Challenge: Practicing `pop` & `shift`

Tâche

Swipe to start coding

  • Use the pop method to remove the last element of the items array.
  • Use a console.log statement to print the array after using pop, in the format: After pop: [ element1, element2, ... ].
  • Use the shift method to remove the first element of the array.
  • Use a console.log statement to print the array after using shift, in the format: After shift: [ element1, element2, ... ].

Note

The pop() method should be used before using the shift() method.

Solution

Switch to desktopPassez à un bureau pour une pratique réelleContinuez d'où vous êtes en utilisant l'une des options ci-dessous
Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 5. Chapitre 7
Switch to desktopPassez à un bureau pour une pratique réelleContinuez d'où vous êtes en utilisant l'une des options ci-dessous
Nous sommes désolés de vous informer que quelque chose s'est mal passé. Qu'est-il arrivé ?
some-alt