MCPcopy Create free account
hub / github.com/cryptii/cryptii / unique

Method unique

src/ArrayUtil.js:92–94  ·  view source on GitHub ↗

* Removes duplicate values from an array. * @param {array} array * @return {mixed} New array with unique items.

(array)

Source from the content-addressed store, hash-verified

90 * @return {mixed} New array with unique items.
91 */
92 static unique (array) {
93 return array.filter((element, index) => array.indexOf(element) === index)
94 }
95
96 /**
97 * Orders array elements randomly using Fisher–Yates modern shuffle algorithm.

Callers 3

isEqualMethod · 0.80
randomizeMethod · 0.80
validateValueMethod · 0.80

Calls 1

indexOfMethod · 0.80

Tested by

no test coverage detected