1
respuesta

Recorrer el array desde la posición 0

<!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>Secreto</title>
    <h1>SECRETO</h1>
  </head>
  <body>
    <input placeholder="Digite numero aqui" />
    <button>Comprobar número secreto</button>
    <script>
      var heroes = ["Superman", "Thor", "Batman", "Mujer Maravilla"];
      for (var i = 0; i < heroes.length; i++) {
        alert(heroes[i]);
      }
    </script>
  </body>
</html>
1 respuesta

Hola , espero que estés muy bien.

Estamos muy contentos con tu aprendizaje. Gracias por compartir tu código con nosotros. Continúa con tus estudios y cualquier duda estaremos aquí =)

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