> For the complete documentation index, see [llms.txt](https://martins-victor.gitbook.io/1loc-lib/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://martins-victor.gitbook.io/1loc-lib/one-liners/maketallybyproperty.md).

# makeTallyByProperty

Creates a tally (count) of objects in an array

Given an array of objects, this function makes a tally or counts the occurrence of similar objects based on a given property.

```javascript
import { makeTallyByProperty } from "1loc";

const arr = [
    { brand: 'audi', model: 'q8', year: '2019' },
    { brand: 'audi', model: 'rs7', year: '2020' },
    { brand: 'ford', model: 'mustang', year: '2019' },
    { brand: 'ford', model: 'explorer', year: '2020' },
    { brand: 'bmw', model: 'x7', year: '2020' },
]

makeTallyByProperty(arr, 'brand') 

// { 'audi': 2, 'ford': 2, 'bmw': 1 }
```
