Challenge: Counting Elements
Uppgift
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
Var allt tydligt?
Tack för dina kommentarer!
Avsnitt 5. Kapitel 9