https://github.com/lamansky/has-duplicates
A Node.js module that checks an array for duplicate elements or a string for duplicate characters.
https://github.com/lamansky/has-duplicates
Last synced: 3 months ago
JSON representation
A Node.js module that checks an array for duplicate elements or a string for duplicate characters.
- Host: GitHub
- URL: https://github.com/lamansky/has-duplicates
- Owner: lamansky
- License: mit
- Created: 2017-02-14T08:56:35.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-02-14T09:01:50.000Z (over 9 years ago)
- Last Synced: 2025-03-03T15:02:52.482Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 1000 Bytes
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license.txt
Awesome Lists containing this project
README
# has-duplicates
A [Node.js](https://nodejs.org/) module that checks an array for duplicate elements or a string for duplicate characters.
## Installation
```bash
npm install has-duplicates --save
```
## Usage
```javascript
const hasDuplicates = require('has-duplicates')
// Arrays
hasDuplicates([1, 1]) // true
hasDuplicates([1, 2]) // false
// Strings
hasDuplicates('aa') // true
hasDuplicates('ab') // false
```