title: Find index in array of objects
body: <p>I would like to find index in array. Positions in array are objects, and I want to filter on their properties. I know which keys I want to filter and their values. Problem is to get index of array which meets the criteria.</p>
  
  <p>For now I made code to filter data and gives me back object data, but not index of array.</p>
  
  <pre><code>var data =  [
          {
              "text":"one","siteid":"1","chid":"default","userid":"8","time":1374156747
          },
          {
              "text":"two","siteid":"1","chid":"default","userid":"7","time":1374156735
          }
      ];
  
  var filterparams = {userid:'7', chid: 'default'};
  
  function getIndexOfArray(thelist, props){
      var pnames = _.keys(props)
      return _.find(thelist, function(obj){
          return _.all(pnames, function(pname){return obj[pname] == props[pname]})
      })};
  
  var check = getIndexOfArray(data, filterparams ); // Want to get '2', not key =&gt; val
  </code></pre>