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