Removed duplicate elements from the array
npm install unique-arrayjs
var unique = require('unique-array');
unique([1, 1, 2, 3, 4]);
//=> [1, 2, 3, 4]
unique(['a', 'b', 'github', 'a', 'github']);
//=> ['a', 'b', 'github']
`
When removing duplicates, the position of the first occurrence of each value will be retained. For example,
`js
unique([1, 2, 3, 4, 4, 5, 1, 6])
//=> [1, 2, 3, 4, 5, 6]
`
Usage
#### require('unique-array')( array )
Return unique elements of an input array.
Arguments:
- array`: A javascript array with elements to be unique'd.