Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprende Challenge: Finding the Average Price of Items | Section
JavaScript Essentials for Beginners - 1768407374405

bookChallenge: Finding the Average Price of Items

Tarea

Swipe to start coding

You're working at a local electronics store. Your manager has asked you to calculate the average price of all the items in stock. Instead of doing the math manually, you decide to write a JavaScript program to get the job done quickly!

  • Create a variable totalPrice and set it to 0.
  • Use a for loop to loop through all the elements of prices and add their values to totalPrice.
  • After the loop completes, output the totalPrice divided by the number of items (length of prices array).

Solución

¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 1. Capítulo 74
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: Finding the Average Price of Items

Desliza para mostrar el menú

Tarea

Swipe to start coding

You're working at a local electronics store. Your manager has asked you to calculate the average price of all the items in stock. Instead of doing the math manually, you decide to write a JavaScript program to get the job done quickly!

  • Create a variable totalPrice and set it to 0.
  • Use a for loop to loop through all the elements of prices and add their values to totalPrice.
  • After the loop completes, output the totalPrice divided by the number of items (length of prices array).

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

single

some-alt