1
respuesta

Condicional o loop while.

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>AÑO DEL MUNDIAL</title>
    <H1>AÑOS DEL MUNDIAL</H1>
</head>
<body>

</body>
<script>
    // Salto de linea
     function lineJump1() {
  document.write('<br>');
  document.write('<br>');
  document.write('<br>');
};

// Mostrar en pantalla

print = sentence => {
    document.write(`<big>  ${sentence} </big>`);
    lineJump1();
};

let yearsworld = 1930,
    limit = parseInt(prompt('Ingrese el año limite'));

while (yearsworld <= limit){

    print(`Hubo mundial de la FIFA en el año ${yearsworld}`);
    yearsworld = yearsworld + 4;
};

print('Fin');

</script>
</html>
1 respuesta

Hola , espero que esté bien.

Gracias por compartir tu código con nosotros, he probado aquí y el resultado ha sido muy bueno.