Novelty Polygonal Mathematics
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

array-duplicated

2.0.0 • Public • Published

array-duplicated

npm version Build Status Coverage Status

Return 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.

arrayDuplicated([0, 1, 1, 1, 1, 1, 1, 1, 1, 1]); //=> [1]

"Duplicated" means a value is identical to another value in the ECMAScript same-value equality level.

arrayDuplicated([-1, 1]); //=> []

License

ISC License © 2017 - 2018 Shinnosuke Watanabe

install

npm i array-duplicated

Downloadsweekly downloads

155

version

2.0.0

license

ISC

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability