title: Javascript: grab object in array based on subobject value
body: <p>If I have this object:</p>
  
  <pre><code>DropIds = [
    {
      "studentId": 5,
      "dropboxItems": [
          {
              "dropBoxId": 230,
          }
      ]
    },
    {
      "studentId": 4,
      "dropboxItems": [
          {
              "dropBoxId": 585,
          },
          {
              "dropBoxId": 586,
          }
      ]
    }
  ]
  </code></pre>
  
  <p>And I try to run this code:</p>
  
  <pre><code>var result = $.grep(DropIds, function(e){
      return e.dropboxItems[0].dropBoxId == 585;
  });
  </code></pre>
  
  <p>it will return a result, however if I change it from 585 to 586 the result is empty.</p>
  
  <p><a href="http://jsfiddle.net/tdb70f50/1/" rel="nofollow">http://jsfiddle.net/tdb70f50/1/</a></p>
  
  <p>So it looks like my code will only check the first object in the array.</p>
  
  <p>How can I grab the object when there is more than one dropBoxId?</p>
  
  <p>Thanks!</p>