README
array-duplicated
Return duplicated values in a given Array
arrayDuplicated(['a', 2, 'b', true, 'b', 12, 'b', true, ['a']]) //=> ['b', true];
Installation
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