Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprenda Challenge: Counting Elements | Section
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
JavaScript Essentials for Beginners - 1768407374405

bookChallenge: Counting Elements

Tarefa

Swipe to start coding

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

  1. Create a variable named numberOfFruits and assign it the length of the fruitBasket array.
  2. Use an if...else statement to:
    • Print "We have a small fruit basket with [number] fruits!" if there are 3 or fewer fruits.
    • Print "We have a big fruit basket with [number] fruits!" if there are more than 3 fruits.
  3. Make sure you use the numberOfFruits variable in your console messages. Do not hardcode any numbers.

Solução

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 1. Capítulo 64
single

single

Pergunte à IA

expand

Pergunte à IA

ChatGPT

Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo

close

bookChallenge: Counting Elements

Deslize para mostrar o menu

Tarefa

Swipe to start coding

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

  1. Create a variable named numberOfFruits and assign it the length of the fruitBasket array.
  2. Use an if...else statement to:
    • Print "We have a small fruit basket with [number] fruits!" if there are 3 or fewer fruits.
    • Print "We have a big fruit basket with [number] fruits!" if there are more than 3 fruits.
  3. Make sure you use the numberOfFruits variable in your console messages. Do not hardcode any numbers.

Solução

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 1. Capítulo 64
single

single

some-alt