Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprenda Challenge: Fixing the Speed Function | Section
JavaScript Essentials for Beginners - 1768407374405

bookChallenge: Fixing the Speed Function

Tarefa

Swipe to start coding

Previously, we created a calcSpeed function for calculating the average speed of a car.

Now you need to fix the function so that it can accept values from outside of the function.

  • Remove the local variables distance and timeTaken inside the function.
  • Add two parameters named distance and timeTaken inside the parentheses of the calcSpeed function.
  • Finally, call the calcSpeed function twice with the corresponding arguments:
    • 1000 meters, 120 seconds.
    • 1200 meters, 160 seconds.

Solução

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 1. Capítulo 50
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: Fixing the Speed Function

Deslize para mostrar o menu

Tarefa

Swipe to start coding

Previously, we created a calcSpeed function for calculating the average speed of a car.

Now you need to fix the function so that it can accept values from outside of the function.

  • Remove the local variables distance and timeTaken inside the function.
  • Add two parameters named distance and timeTaken inside the parentheses of the calcSpeed function.
  • Finally, call the calcSpeed function twice with the corresponding arguments:
    • 1000 meters, 120 seconds.
    • 1200 meters, 160 seconds.

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 50
single

single

some-alt