title: Loop through Map in Groovy?
body: <p>I have a very simple task I am trying to do in Groovy but cannot seem to get it to work. I am just trying to loop through a map object in groovy and print out the key and value but this code does not work.</p>
  
  <pre><code>// A simple map
  def map = [
          iPhone : 'iWebOS',
          Android: '2.3.3',
          Nokia  : 'Symbian',
          Windows: 'WM8'
  ]
  
  // Print the values
  for (s in map) {
      println s + ": " + map[s]
  }
  </code></pre>
  
  <p>I am trying to get the output to look like this:</p>
  
  <pre><code>iPhone: iWebOS
  Android: 2.3.3
  Nokia: Symbian
  Windows: WM8
  </code></pre>
  
  <p>Could someone please elaborate on how to do this??</p>