Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JavaScript Loop Through an Array Using For Loop</title> </head> <body> <script> let fruits = ["Apple", "Banana", "Mango", "Orange", "Papaya"]; // Iterates over array elements for(let i = 0; i < fruits.length; i++){ document.write(fruits[i] + "<br>"); // Print array element } </script> </body> </html>