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

Method isUnique

src/ArrayUtil.js:82–85  ·  view source on GitHub ↗

* Checks if an array only contains unique values (no duplicates). * @param {array} array * @return {boolean} True, if array only contains unique values.

(array)

Source from the content-addressed store, hash-verified

80 * @return {boolean} True, if array only contains unique values.
81 */
82 static isUnique (array) {
83 return array.findIndex((element, index) =>
84 array.indexOf(element) !== index) === -1
85 }
86
87 /**
88 * Removes duplicate values from an array.

Callers 2

validateValueMethod · 0.80

Calls 1

indexOfMethod · 0.80

Tested by

no test coverage detected