title: How to count nested object value with angular.forEach?
body: <p>my object :  </p>
  
  <pre><code>service: {
      categories: [0: {
              name: "category1",
              id: 2,
              questions: [0: {
                  id: 1,
                  question: "example trivia question here",
                  value: 1
              }]]
      }
  </code></pre>
  
  <p>Basically, I need to find where there is a value present in a statement and count it.</p>
  
  <pre><code>$scope.questionCount = 0;
  
  angular.forEach($scope.service, function(categories, questions) {
    for (var i = 0; i &lt; questions.length; i++) {
      if (questions[i].value !== null){
        $scope.questionCount += 1
      }
  }
  });
  </code></pre>
  
  <p>this is what I've tried, but when I console.log, I"m still getting 0.  I'm looping incorrectly or not checking the value correctly. Any help, appreciated. </p>