1.0.0 • Published 2 years ago
arr-unique-value v1.0.0
arr-unique-value
Return only unique values from an array, removing all repeated values.
Install
Install with npm:
$ npm install --save arr-unique-value
Usage
Works with array of strings and numbers, does not accept array of objects
const uniqueValue = require('arr-unique-value');
console.log(uniqueValue([1, 1, [2, 2, [3, 3, 3]], [4, 4]])); //=> [1, [2, [3]], [4]]
console.log(uniqueValue(['1', '1', ['2', '2', ['3', '3', '3']], ['4', '4']])); //=> ['1', ['2', ['3']], ['4']]
console.log(uniqueValue([1, 1, 'testing', 'testing', ['testingTwo', 'testingTwo']])); //=> [1, 'testing', ['testingTwo']]
Author
Otavio Rampinelli
License
Copyright © 2022, Otavio Rampinelli. Released under the MIT License.
1.0.0
2 years ago