unique

Type:Function
Status:stable
Since:1.0.0
Platform:jsnode
@blackbyte.sugar.shared.array

This function simply take an array as parameter and return a new one with all the duplicates values removed.

Params

  1. array*-Array

    The array to deduplicates

Return

  1. -Array

    The deduplicated array

Example

import { unique } from '@blackbyte/sugar/array';
unique(['hello','world','hello','world']); // => ['hello','world']

Changelog

  • 1.0.0-beta.2
    Add the “stringify” option to compare objects in string format