Challenge: Pushing Elements to an Array
Oppgave
Swipe to start coding
- You have an array named
shoppingListthat contains the following three elements:Milk,Eggs, andBread. - 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, ...].
Løsning
Alt var klart?
Takk for tilbakemeldingene dine!
Seksjon 1. Kapittel 60
single
Spør AI
Spør AI
Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår
Fantastisk!
Completion rate forbedret til 1.33
Challenge: Pushing Elements to an Array
Sveip for å vise menyen
Oppgave
Swipe to start coding
- You have an array named
shoppingListthat contains the following three elements:Milk,Eggs, andBread. - 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, ...].
Løsning
Alt var klart?
Takk for tilbakemeldingene dine!
Seksjon 1. Kapittel 60
single