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

bookChallenge: Fixing the Speed Function

Tarea

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.

Solución

¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 1. Capítulo 50
single

single

Pregunte a AI

expand

Pregunte a AI

ChatGPT

Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla

close

bookChallenge: Fixing the Speed Function

Desliza para mostrar el menú

Tarea

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.

Solución

Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 1. Capítulo 50
single

single

some-alt