@g-lib/unique
v0.0.1
Published
unique is a function that remove any duplicates from an array.
Downloads
4
Maintainers
Readme
unique
Function that removes any duplicated elements in the array.
install
npm i @g-lib/unique
yarn add @g-lib/unique
pnpm add @g-lib/unique
Usage:
import unique from '@g-lib/unique';
// or
const unique = require('@g-lib/unique');
console.log(
unique([
{ a: { key: 'a' }, b: 'b' },
{ a: { key: 'a' }, b: 'b' },
]),
); // [{a: {key: "a"}, b: "b"}]
console.log(
unique([
[1, 2, true, undefined],
[1, 2, true, undefined],
]),
); // [[1,2,true, undefined ]]
// ...