generate functionFri, 21 Jul 2023

Actividades de arrays: 2. Encontrar mayor temperatura teniendo este array: [25, 30, 28, 32, 29, 27];

function mayorTemperatura(temp) { var max = temp[0]; for (var i = 0; i < temp.length; i++) { if (temp[i] > max) { max = temp[i]; } } return max; } var temperaturas = [25, 30, 28, 32, 29, 27]; mayorTemperatura(temperaturas);

Javascript
Generate More

Want to kickstart your project?Use the new AI Studio to create your code