Curso

pruebas

Código original (javascript)

1// Calcula la longitud de un vector
2let x = 5;
3let y = 3;
4const valor = Math.sqrt(x * x + y * y)

Código modificado (javascript)

1function calcularLongitud(x, y) {
2  return Math.sqrt(x * x + y * y);
3}
4const valor = calcularLongitud(5,3)