Method count documentation
Counts the number of objects matching the given filter in the given array.
Example
```javascript
let ar = [
  {name: "Raiders of the lost ark", director: "Steven Spielberg", year: 1981, id: 589},
  {name: "Goonies", director: "Richard Donner", year: 1985, id: 689},
  {name: "Star wars", director: "George Lucas", year: 1977, id: 256},
  {name: "Jaws", director: "Steven Spielberg", year: 1975, id: 423}
];
bbn.fn.count(ar, "id", 256);
// 1
bbn.fn.count(ar, {director: "Steven Spielberg"});
// 2
bbn.fn.search(ar, "year", 1975, ">");
// 3
// Complex filters: all the movies from Spielberg between 1974 and 1980
bbn.fn.search(ar, {
  logic: "AND",
  conditions: [
    {
      field: "director",
      operator: "eq",
      value: "Steven Spielberg"
    }, {
      logic: "AND",
      conditions: [
        {
           field: "year",
           operator: ">=",
           value: 1974
        }, {
           field: "year",
           operator: "<=",
           value: 1980
        }
      ]
    }
  ]
});
// 1
```
  Counts the number of objects matching the given filter in the given array. - The arguments follow the same scheme as bbn.fn.search.
 BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way
  
  
    
    
      
        
        
      
    
    
    
      
      
      
      
      
        
          
          
          
          
          
          
          
          
            
              
                
              
            
            
              
              This website uses cookies to ensure you get the best experience on our website.                
                
              
              
                
                
              
             
           
          
          
          
            
            © 2011-2025 
BBN Solutions