Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
学ぶ Challenge: Counting Elements | Section
JavaScript Fundamentals
セクション 1.  62
single

single

bookChallenge: Counting Elements

メニューを表示するにはスワイプしてください

タスク

スワイプしてコーディングを開始

You are given an array called fruitBasket that contains several fruit names.

Your tasks:

  • Create a variable named numberOfFruits and assign it the length of the fruitBasket array.
  • Use an if...else statement to generate a message:
  • If there are 3 or fewer fruits, return: "We have a small fruit basket with [number] fruits!"
  • If there are more than 3 fruits, return: "We have a big fruit basket with [number] fruits!"
  • Use the numberOfFruits variable inside the message.
  • Do NOT hardcode the number.

解答

Switch to desktop実践的な練習のためにデスクトップに切り替える下記のオプションのいずれかを利用して、現在の場所から続行する
すべて明確でしたか?

どのように改善できますか?

フィードバックありがとうございます!

セクション 1.  62
single

single

AIに質問する

expand

AIに質問する

ChatGPT

何でも質問するか、提案された質問の1つを試してチャットを始めてください

some-alt