Run

Tutorial With Example

Run your live code

 
​x
 
1
<html>
2
<head></head>
3
<body>
4
  <script>
5
  var fruits = ["Apple", "Banana", "Mango", "Orange", "Papaya"];
6
​
7
  // Loop through all the elements in the array 
8
  for(var i in fruits) {  
9
      document.write(fruits[i] + "<br>");
10
  }
11
  </script>
12
</body>
13
</html>