title: Output Json Arrays with Javascript
body: <p>I am really new to Javascript and Json and need help with the following. This is some json data:</p>
  
  <pre><code>"genres": [
  
   {
      "id": 28,
      "name": "Action"
   },
   {
      "id": 18,
      "name": "Drama"
   },
   {
      "id": 14,
      "name": "Fantasy"
   },
   {
      "id": 36,
      "name": "History"
   }
  
  ],
  </code></pre>
  
  <p>Now I would like to output all names of genres</p>
  
  <p>I'm working with jquery mobile and ajax to retrieve json data. Inside my function it looks sth like this:</p>
  
  <pre><code>var genres = results.genres[0].name;
  $('#tmdbInfo2').html('&lt;br&gt;Genres: ' +genres);
  </code></pre>
  
  <p>In this example the first element of genres will we shown (Action), but not all.
  The output should be: Action, Drama, Fantasy, History.
  Sometimes the number of elements of genres varies..</p>
  
  <p>Please help me, its very confusing for me O_o</p>