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