JS Dasar: 35. While loop

by istiq20

HTML

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>While loop</title>
  </head>
  <body>
    <script>
      let counter = 1;
      while (counter <= 10) {
        document.writeln(`<p>Perulangan ke ${counter}</p>`);
        counter++;
      }
    </script>
  </body>
</html>