title: Push data into JSON array
body: <p>I'm making a Chrome app and I want to save the name and the artist of a song into a json file. I know how that can be done, but I don't know how to put in the data (here: <code>title</code> and <code>artist</code>) into a json array. We assign:</p>
  <pre><code>var favorites = [];
  </code></pre>
  <p>So if someone presses the star, the artist and the name of the song should be put into <code>favorites</code>:</p>
  <pre class="lang-js prettyprint-override"><code>$(document).on('click','.fa-star-o', function() {
      var title = $(this).parent().find('.tracktitle').text(),
          artist = $(this).parent().find('.artist').text();
  
      $(this)
          .removeClass('fa-star-o')
          .addClass('fa-star');
      $('&lt;li/&gt;')
          .append('&lt;span class=&quot;tracktitle&quot;&gt;'+ title +'&lt;/span&gt;')
          .append('&lt;span class=&quot;artist&quot;&gt;'+ artist +'&lt;/span&gt;')
          .prependTo($favorites);
  });
  </code></pre>