Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lära Challenge: Counting Elements | Exploring Arrays
Introduction to JavaScript

Svep för att visa menyn

book
Challenge: Counting Elements

Uppgift

Swipe to start coding

  • Initialize numberOfFruits with the length of the fruitBasket 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

Switch to desktopByt till skrivbordet för praktisk övningFortsätt där du är med ett av alternativen nedan
Var allt tydligt?

Hur kan vi förbättra det?

Tack för dina kommentarer!

Avsnitt 5. Kapitel 9

Fråga AI

expand
ChatGPT

Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal

book
Challenge: Counting Elements

Uppgift

Swipe to start coding

  • Initialize numberOfFruits with the length of the fruitBasket 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

Switch to desktopByt till skrivbordet för praktisk övningFortsätt där du är med ett av alternativen nedan
Var allt tydligt?

Hur kan vi förbättra det?

Tack för dina kommentarer!

Avsnitt 5. Kapitel 9
Switch to desktopByt till skrivbordet för praktisk övningFortsätt där du är med ett av alternativen nedan
Vi beklagar att något gick fel. Vad hände?
some-alt