find-array-duplicate
This plugin is to find and return duplicated array elements.
const findDuplicates = ;const testArr = a: 'a' b: 'a' 'b' c: 'c' a: 'a' b: 'a' 'b' c: 'c' name: 'Khoa' a: b: c: 'c' 'dev' 'Khoa' 1 2 3 'dev' a: 'a' b: 'a' 'b' 'c' 3 'Khoa' a: 'a' b: 'a' 'b' 'c' ;// [ { value: { a: 'a', b: ['a', 'b', { c: 'c' } ] }, position: [ 0, 1 ] },// { value: 'dev', position: [ 3, 8 ] },// { value: 'Khoa', position: [ 4, 11 ] },// { value: 3, position: [ 7, 10 ] },// { value: { a: 'a', b: ['a', 'b', 'c'] }, position: [ 9, 12 ] } ]
Related projects
- find-array: Find and return right elements in an array. | homepage
Install
$ npm install find-array-duplicate