Challenge: Practicing `pop` & `shift`
Tehtävä
Swipe to start coding
- Use the
popmethod to remove the last element of theitemsarray. - Use a
console.logstatement to print the array after usingpop, in the format:After pop: [ element1, element2, ... ]. - Use the
shiftmethod to remove the first element of the array. - Use a
console.logstatement to print the array after usingshift, in the format:After shift: [ element1, element2, ... ].
Note
The
pop()method should be used before using theshift()method.
Ratkaisu
Oliko kaikki selvää?
Kiitos palautteestasi!
Osio 1. Luku 62
single
Kysy tekoälyä
Kysy tekoälyä
Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme
Mahtavaa!
Completion arvosana parantunut arvoon 1.33
Challenge: Practicing `pop` & `shift`
Pyyhkäise näyttääksesi valikon
Tehtävä
Swipe to start coding
- Use the
popmethod to remove the last element of theitemsarray. - Use a
console.logstatement to print the array after usingpop, in the format:After pop: [ element1, element2, ... ]. - Use the
shiftmethod to remove the first element of the array. - Use a
console.logstatement to print the array after usingshift, in the format:After shift: [ element1, element2, ... ].
Note
The
pop()method should be used before using theshift()method.
Ratkaisu
Oliko kaikki selvää?
Kiitos palautteestasi!
Osio 1. Luku 62
single