Challenge: Pushing Elements to an Array
Opgave
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
Var alt klart?
Tak for dine kommentarer!
Sektion 1. Kapitel 60
single
Spørg AI
Spørg AI
Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat
Fantastisk!
Completion rate forbedret til 1.33
Challenge: Pushing Elements to an Array
Stryg for at vise menuen
Opgave
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
Var alt klart?
Tak for dine kommentarer!
Sektion 1. Kapitel 60
single