Challenge: Counting Elements
Oppgave
Swipe to start coding
- Initialize
numberOfFruits
with the length of thefruitBasket
array. - If
numberOfFruits
has 3 or fewer fruits, print:"We have a small fruit basket with [number] fruits!"
, where[number]
should be the number of fruits. - If
numberOfFruits
has more than 3 fruits, print:"We have a big fruit basket with [number] fruits!"
.
Løsning
Alt var klart?
Takk for tilbakemeldingene dine!
Seksjon 5. Kapittel 9