title: How to find object with value in array using lodash
body: <p>Give the following JS array:</p>
  
  <pre><code>vm.todayShifts = [];
  vm.todayShifts['am'] = 
      {
        station: "1",
        slots: {
          position: "AO", 
          name: "Person One"
        },
        slots: {
          position: "FF", 
          name: "Person Two"
        },
        slots: {
          position: "PFF", 
          name: "Person Three"
        },
      },
      {
        station: "2",
        slots: {
          position: "AO", 
          name: "Person Four"
        },
        slots: {
          position: "FF", 
          name: "Person Fve"
        },
        slots: {
          position: "PFF", 
          name: "Person Six"
        },
      },
    ],
  todayShifts['pm'] = 
      {
        station: "1",
        slots: {
          position: "AO", 
          name: "Person Seven"
        },
        {
          position: "FF", 
          name: "Person Eight"
        },
        {
          position: "PFF", 
          name: "Person Nine"
        },
      },
      {
        station: "2",
        slots: {
          position: "AO", 
          name: "Person Ten"
        },
        {
          position: "FF", 
          name: "Person Eleven"
        },
        {
          position: "PFF", 
          name: "Person Twelve"
        },
      },
    ]
  </code></pre>
  
  <p>at one point in a loop, I have the station.id and dayPart (am or pm) values, and I need to see if the todayShift array contains an object that is in the appropriate dayPart and has the station.id value, and return that object if it exists. I've tried this with lodash:</p>
  
  <pre><code>      if (typeof vm.todayShifts[dayPart] != 'undefined') {
          var shift = _.find(vm.todayShifts[dayPart], {'station': station.id});
        }
  </code></pre>
  
  <p>but nothing is returned even when there is data that matches the criteria (e.g. dayPart="am" and station = 1).</p>
  
  <p>This is already in a loop (inside a <a href="https://mattlewis92.github.io/angular-bootstrap-calendar/#?example=cell-modifier" rel="nofollow">cell modifier</a> for a <a href="https://mattlewis92.github.io/angular-bootstrap-calendar/#?example=custom-templates" rel="nofollow">custom cell template</a> with Angular Bootstrap calendar), so I don't want to loop through todayShifts every time if I don't have to, since this controller will get called ~30 times per page.</p>
  
  <p>Am I close? Or is there an easier way to check for and get that object?</p>
  
  <p>Thanks.</p>