Perulangan
for
<h1>Perulangan</h1>
<script>
for (let index = 1; index <= 10; index++) {
console.log("Aku baca buku halaman ", index);
}
</script>for in
<h1>Perulangan</h1>
<script>
var pages = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
for (const index in pages) {
console.log("Aku baca buku halaman ", pages[index]);
}
</script>for of
foreach
while
Last updated