Show Output
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JavaScript for-of Loop Demo</title> </head> <body> <script> var fruits = ["Apple", "Banana", "Orange", "Mango", "Pineapple"]; // Loop through the fruits array and display all the values for(var fruit of fruits){ document.write("<p>" + fruit + "</p>"); } </script> </body> </html>