title: Iterating over objects in a JSON array with JavaScript
body: <p>I am trying to rewrite a .php multi-dimentional array and foreach loop (the one used in the "Sponsor Flip Wall" jQuery example found at <a href="http://tutorialzine.com/2010/03/sponsor-wall-flip-jquery-css/" rel="nofollow noreferrer">http://tutorialzine.com/2010/03/sponsor-wall-flip-jquery-css/</a>) in JSON/JavaScript, as unfortunately the Web host I am being forced to use does not have PHP support.</p>
  
  <p>The array originally looked as follows:</p>
  
  <pre><code>$sponsors = array(
  array('facebook','The biggest social network in the world.','http://www.facebook.com/'),
  array('adobe','The leading software developer targeted at web designers and developers.','http://www.adobe.com/'),
  array('microsoft','One of the top software companies of the world.','http://www.microsoft.com/')
  );
  </code></pre>
  
  <p>and I now have the following:</p>
  
  <pre><code>var sponsors = [
      { "name": "facebook", "description": "The biggest social network in the world.", "website": "http://www.facebook.com/" },
      { "name": "adobe", "description": "The leading software developer targeted at web designers and developers.", "website": "http://www.adobe.com/" },
      { "name": "microsoft", "description": "One of the top software companies of the world.", "website": "http://www.microsoft.com/" },
  ];
  </code></pre>
  
  <p>However I am stumped at the foreach loop, as I don't believe JavaScript has a direct comparison? Upon research, it seems I will either need to use the jQuery <em>$.each</em> or for loops within for loops.</p>
  
  <p>I was looking at the answer to <a href="https://stackoverflow.com/questions/1078118/how-to-iterate-over-a-json-structure">How do I iterate over a JSON structure?</a> but is seems that their array only contains two values - an object and a key. Mine has multiple fields per object so I don't think it completely applies? Or if it does, I don't know how to expand upon it?</p>
  
  <p>The .php foreach loop I am trying to recreate:</p>
  
  <pre><code>foreach($sponsors as $company)
      {
          echo $company[0] . ":" . $company[1] . "(" . $company[2] . ")"; //eg.
      }
  </code></pre>
  
  <p>Any ideas?  (I would prefer my answer was written purely in JavaScript as opposed to jQuery, if possible)</p>