We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
dedupe creates a copy of an array of strings, numbers, or booleans with only unique values.
orig: Array<string | number | boolean>
An array of strings, numbers, or booleans that you would like to deduplicate.
A copy of orig from which all duplicate values have been removed.
orig
import { dedupe } from '@revolutionarygamesco/common' dedupe(['a', 'a', 'b', 'b', 'c', 'c', 'c']) // ['a', 'b', 'c'] dedupe([1, 2, 2, 3, 3, 3]) // [1, 2, 3] dedupe([true, true, true, false]) // [true, false] dedupe(['a', 'a', 3, 3, 3, true, true, false]) // ['a', 3, true, false]