title: How can get a count with nested objects with a certain property?
body: <p>Okay so I'm using angular to get a json saved to my computer to recreate a github gradebook.</p>
  
  <p>I can get the data with my $http request but for the love of me all I want is to get a count of the number of issues with the label "Not Yet".</p>
  
  <p>Here is the javascript:</p>
  
  <pre><code>$http.get('/api/github/repos/issues/all_issues/00All.json')
    .then(function(response) {
      console.log(response.data[0]);
      var counter = 0;
      for(var index = 0; index &lt; response.data.length; index++) {
        if(response.data[index].labels[0].name == "Not Yet") {
          counter++;
        };
      };
      console.log(counter);
    });
  </code></pre>
  
  <p>That's the latest try, I also tried using lodash to get it earlier:</p>
  
  <pre><code>$http.get('/api/github/repos/issues/all_issues/00All.json')
    .then(function(response) {
      console.log(response);
      mile.notYet.width = _.forEach(response.data, function(n){
        var counter = 0;
        if(_.result(_.find(n.labels[0], 'name')) == "Not Yet") {
          counter++;
        }
        console.log(counter);
        counter = ((counter/10) * 100) + '%';
      });
    });
  </code></pre>
  
  <p>This is a bit of the json data:</p>
  
  <pre><code>[
    {
      "url": "https://api.github.com/repos/TheIronYard--Orlando/2015--SUMMER--FEE/issues/11",
      "labels_url": "https://api.github.com/repos/TheIronYard--Orlando/2015--SUMMER--FEE/issues/11/labels{/name}",
      "comments_url": "https://api.github.com/repos/TheIronYard--Orlando/2015--SUMMER--FEE/issues/11/comments",
      "events_url": "https://api.github.com/repos/TheIronYard--Orlando/2015--SUMMER--FEE/issues/11/events",
      "html_url": "https://github.com/TheIronYard--Orlando/2015--SUMMER--FEE/issues/11",
      "id": 73013825,
      "number": 11,
      "title": "00 -- Brace Yourself -- BEN GRIFFITH",
      "user": {
        "login": "Epicurean306",
        "id": 11682684,
        "avatar_url": "https://avatars.githubusercontent.com/u/11682684?v=3",
        "gravatar_id": "",
        "url": "https://api.github.com/users/Epicurean306",
        "html_url": "https://github.com/Epicurean306",
        "followers_url": "https://api.github.com/users/Epicurean306/followers",
        "following_url": "https://api.github.com/users/Epicurean306/following{/other_user}",
        "gists_url": "https://api.github.com/users/Epicurean306/gists{/gist_id}",
        "starred_url": "https://api.github.com/users/Epicurean306/starred{/owner}{/repo}",
        "subscriptions_url": "https://api.github.com/users/Epicurean306/subscriptions",
        "organizations_url": "https://api.github.com/users/Epicurean306/orgs",
        "repos_url": "https://api.github.com/users/Epicurean306/repos",
        "events_url": "https://api.github.com/users/Epicurean306/events{/privacy}",
        "received_events_url": "https://api.github.com/users/Epicurean306/received_events",
        "type": "User",
        "site_admin": false
      },
      "labels": [
        {
          "url": "https://api.github.com/repos/TheIronYard--Orlando/2015--SUMMER--FEE/labels/Not%20Yet",
          "name": "Not Yet",
          "color": "e11d21"
        }
      ],
  </code></pre>
  
  <p>As you can see the labels property is an object, nested in an array, nested in an object, nested in an array, real lovely. Putting labels[0] results in an error for me each time and doesn't get me a count. Can anybody tell me where I'm messing up please? Thank you!</p>