back to Overview

.uniq()

Takes a list of values and removes all duplicates.
Util module only.

Syntax Variants

list.uniq()
_.uniq(list)

Parameters

list
The list of values. Can be an array, a Minified list or any other array-like structure with length property.
(return value)
A Minified list without duplicates.

Description

Takes a list of values and removes all duplicates. If a value occurs more than once in the input list, only the first occurrence will be kept and all following occurrences will be filtered out.

Uses object properties to keep track which values already occurred. This means that it only works with simple values that can be converted to strings.

Comments

comments powered by Disqus

back to Overview

Functions