Unique first count
items from array
Array array
Any Array
Function predicate
optionalReturn value of function is used to
import { Unique } from "@taystack/js-helpers";
const array = [2,2,3,3,3,4];
Unique(array) // [2,3,4]
// With a predicate
const collection = [{a: 1}, {a: 1}, {a: 3}];
Unique(collection, x => x.a); // [{a: 1}, {a: 3}];
Source: @taystack/js-helpers hosted on GitHub Author: taystack