Challenge: Counting Elements
Taak
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!"
.
Oplossing
Was alles duidelijk?
Bedankt voor je feedback!
Sectie 5. Hoofdstuk 9