title: jQuery - Search through JSON array
body: <p>I need to search through JSON data and find every object that contains the "kind" "playlist" and then go through the tracks and pull information which will be put into a hmtl list. The problem is that in some instances (depending on the type of URL) instead of a multidimensional array containing all the objects, the json information is just a singular object.</p>
  
  <p>Below are the two url types. </p>
  
  <p>This is a playlist which contains just one level of information.
  <a href="http://api.soundcloud.com/playlists/1980151.json?client_id=bcc776e7aa65dbc29c40ff21a1a94ecd" rel="nofollow">http://api.soundcloud.com/playlists/1980151.json?client_id=bcc776e7aa65dbc29c40ff21a1a94ecd</a></p>
  
  <p>This is an array which contains just multiple playlists as objects.
  <a href="http://api.soundcloud.com/users/dubstep/playlists.json?client_id=bcc776e7aa65dbc29c40ff21a1a94ecd" rel="nofollow">http://api.soundcloud.com/users/dubstep/playlists.json?client_id=bcc776e7aa65dbc29c40ff21a1a94ecd</a></p>
  
  <p>The current code I have is this:</p>
  
  <pre><code>$.getJSON('http://api.soundcloud.com/users/dubstep/playlists.json?client_id=bcc776e7aa65dbc29c40ff21a1a94ecd', { get_param: 'value' }, function(url_data) {
  $.each(url_data, function (i, elem) {
      if (elem.kind === 'playlist') {
          $.each(elem.tracks, function (i, elem) {
              console.log(elem.title);
          });
      }
  });
  </code></pre>
  
  <p>});</p>
  
  <p>It <strong>only</strong> works when dealing with "user" urls where there are multiple playlists. </p>
  
  <p>To sum up what my issue is, I need a way to search through all the levels of an array to find levels with the kind === playlist.</p>