npm-array-unique
Receives array as an input and returns the unique array and also an object whith array items and their occurences
Installation
npm i npm-array-unique
Usage
var arrayUnique = ;
unique(array)
Receives the input array and returns the unique array
var arrayUnique = var inputArray = 1234324345455; arrayUnique; // [ 1, 2, 3, 4, 5] var inputArray2 = 'one' 5 'two' 'three' 5 'one' 'three' 7; arrayUnique; // ['one', 5, 'two','three', 7];
uniqueCount(text)
Receives the input array and returns the unique array
var arrayUnique = var inputArray = 12344445677888; arrayUnique; // { '1': 1, '2': 1, '3': 1, '4': 4, '5': 1, '6': 1, '7': 2, '8': 3 }
itemCount(text)
Receives the input array and returns the unique array
var arrayUnique = var inputArray = 12342342345678906789; arrayUnique; // 2
Demo
Demo @npm-array-unique | https://tonicdev.com/npm/npm-array-unique
Author
Krishcdbry [krishcdbry@gmail.com]
Licence
MIT @krishcdbry