title: Does Javascript have an enhanced for loop syntax similar to Java's
body: <p>I am wondering if JavaScript has an enhanced for loop syntax that allows you to iterate over arrays.  For example, in Java, you can simply do the following:</p>
  
  <pre><code>String[] array = "hello there my friend".split(" ");
  
  for (String s : array){
      System.out.println(s);
  }
  </code></pre>
  
  <p>output is:</p>
  
  <pre><code>hello
  there
  my
  friend
  </code></pre>
  
  <p>Is there a way to do this in JavaScript?  Or do I have to use <code>array.length</code> and use standard for loop syntax as below?</p>
  
  <pre><code>var array = "hello there my friend".split(" ");
  
  for (i=0;i&lt;array.length;i++){
      document.write(array[i]);
  }
  </code></pre>