has-duplicates

1.0.0 • Public • Published

has-duplicates

A Node.js module that checks an array for duplicate elements or a string for duplicate characters.

Installation

npm install has-duplicates --save

Usage

const hasDuplicates = require('has-duplicates')
 
// Arrays
hasDuplicates([1, 1]) // true
hasDuplicates([1, 2]) // false
 
// Strings
hasDuplicates('aa') // true
hasDuplicates('ab') // false

Package Sidebar

Install

npm i has-duplicates

Weekly Downloads

1,861

Version

1.0.0

License

MIT

Last publish

Collaborators

  • lamansky