Ya estoy inscrito ¿Todavía no tienes acceso? Nuestros Planes
Ya estoy inscrito ¿Todavía no tienes acceso? Nuestros Planes
1
respuesta

Diferent Age

Diferent Ages

<script>
  function lineBreak(repeat) {
    for (let i = 1; i <= repeat; i++) {
      document.write("<br>");
    }
  }
  function Print(name, yearBorn) {
    document.write(`${name} has: ${2025 - yearBorn}  years old`);
  }

  function diferentAge(age1, age2) {
    let diferent = Math.abs(age1 - age2);
    document.write(`The diferent ages is: ${diferent}`);
  }
  var age1 = 20;
  var age2 = 30;
  document.write("*************************************");
  lineBreak(3);
  diferentAge(age1, age2);
  lineBreak(3);
  document.write("*************************************");
</script>
1 respuesta

Hola Fernando, espero que estés bien!

Gracias por compartir tu solución, felicitaciones!

Mucho éxito en todo lo que te propongas y si tienes alguna duda aquí estaremos para apoyarte.

¡Vamos juntos!

Si este post te ayudó, por favor, marca como solucionado ✓. Continúa con tus estudios