Nybble Processing Mainframe
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

array-duplicated

2.0.0-1 • Public • Published

array-duplicated

npm version Build Status Coverage Status

Return an Array of duplicated values in a given Array

arrayDuplicated(['a', 2, 'b', true, 'b', 12, 'b', true, ['a']]) //=> ['b', true];

Installation

Use npm.

npm install array-duplicated

API

import arrayDuplicated from 'array-duplicated';

arrayDuplicated(array)

array: Array<any>
Return: Array

It finds duplicated values in the Array and returns an Array of them.

If the Array doesn't contain duplicated values, it returns an empty Array.

arrayDuplicated([0, 1, 1, 1, 1, 1, 1, 1, 1, 1]); //=> [1]
arrayDuplicated([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]); //=> []

License

ISC License © 2017 - 2018 Shinnosuke Watanabe

install

npm i array-duplicated

Downloadsweekly downloads

84

version

2.0.0-1

license

ISC

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability