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

Pyyhkäise näyttääksesi valikon

book
Challenge: Pushing Elements to an Array

Tehtävä

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, ...].

Ratkaisu

Switch to desktopVaihda työpöytään todellista harjoitusta vartenJatka siitä, missä olet käyttämällä jotakin alla olevista vaihtoehdoista
Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 5. Luku 5
Pahoittelemme, että jotain meni pieleen. Mitä tapahtui?

Kysy tekoälyä

expand
ChatGPT

Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme

book
Challenge: Pushing Elements to an Array

Tehtävä

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, ...].

Ratkaisu

Switch to desktopVaihda työpöytään todellista harjoitusta vartenJatka siitä, missä olet käyttämällä jotakin alla olevista vaihtoehdoista
Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 5. Luku 5
Switch to desktopVaihda työpöytään todellista harjoitusta vartenJatka siitä, missä olet käyttämällä jotakin alla olevista vaihtoehdoista
Pahoittelemme, että jotain meni pieleen. Mitä tapahtui?
some-alt