MCPcopy Index your code
hub / github.com/stemkoski/stemkoski.github.com / uniq

Function uniq

MathBox/mathbox-bundle.js:40116–40127  ·  view source on GitHub ↗

* Creates a duplicate-value-free version of an array using strict equality * for comparisons, i.e. `===`. If the array is sorted, providing * `true` for `isSorted` will use a faster algorithm. If a callback is provided * each element of `array` is passed through the callback before un

(array, isSorted, callback, thisArg)

Source from the content-addressed store, hash-verified

40114 * // => [{ 'x': 1 }, { 'x': 2 }]
40115 */
40116 function uniq(array, isSorted, callback, thisArg) {
40117 // juggle arguments
40118 if (typeof isSorted != 'boolean' && isSorted != null) {
40119 thisArg = callback;
40120 callback = (typeof isSorted != 'function' && thisArg && thisArg[isSorted] === array) ? null : isSorted;
40121 isSorted = false;
40122 }
40123 if (callback != null) {
40124 callback = lodash.createCallback(callback, thisArg, 3);
40125 }
40126 return baseUniq(array, isSorted, callback);
40127 }
40128
40129 /**
40130 * Creates an array excluding all provided values using strict equality for

Callers

nothing calls this directly

Calls 1

baseUniqFunction · 0.85

Tested by

no test coverage detected