Returns true if an array has duplicate elements
npm install has-duplicate
Returns true if an array has duplicate elements.
Based on find-indices-of-duplicates.
``sh`
npm install has-duplicate --save
#### Parameters
- array Array The array to checkcomparator
- Function The compare function (optional, default lodash.isequal)
#### Examples
`javascript
import hasDuplicates from 'has-duplicate';
hasDuplicates([1, 2, 3]); // false
hasDuplicates([1, 2, 3, 1]); // true
hasDuplicates([{ v: 1 }, { v: 1 }]); // true
hasDuplicates([{ v: 1 }, { v: 2 }]); // false
hasDuplicates([{ v: 1 }, { v: 1 }], (a, b) => a === b); // false
``
Returns boolean True if has duplicates and false otherwise