Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Apprendre Challenge: Pushing Elements to an Array | Exploring Arrays
Introduction to JavaScript

Glissez pour afficher le menu

book
Challenge: Pushing Elements to an Array

Tâche

Swipe to start coding

  • You have an array named shoppingList that contains the following three elements: Milk, Eggs, and Bread.
  • Use the push() method to add the following two elements to the array: Butter, Cheese. (Please add these elements in the required order)
  • Use a console.log() statement to output the entire array in the format: After: [element1, element2, ...].

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 5

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: Pushing Elements to an Array

Tâche

Swipe to start coding

  • You have an array named shoppingList that contains the following three elements: Milk, Eggs, and Bread.
  • Use the push() method to add the following two elements to the array: Butter, Cheese. (Please add these elements in the required order)
  • Use a console.log() statement to output the entire array in the format: After: [element1, element2, ...].

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 5
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