MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / pull

Function pull

lib/web/jshint.js:6703–6723  ·  view source on GitHub ↗

* Removes all provided values from `array` using `SameValueZero` for equality * comparisons. * * **Notes:** * - Unlike `_.without`, this method mutates `array` * - [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) * comparis

()

Source from the content-addressed store, hash-verified

6701 * // => [1, 1]
6702 */
6703 function pull() {
6704 var args = arguments,
6705 array = args[0];
6706
6707 if (!(array && array.length)) {
6708 return array;
6709 }
6710 var index = 0,
6711 indexOf = getIndexOf(),
6712 length = args.length;
6713
6714 while (++index < length) {
6715 var fromIndex = 0,
6716 value = args[index];
6717
6718 while ((fromIndex = indexOf(array, value, fromIndex)) > -1) {
6719 splice.call(array, fromIndex, 1);
6720 }
6721 }
6722 return array;
6723 }
6724
6725 /**
6726 * Removes elements from `array` corresponding to the given indexes and returns

Callers

nothing calls this directly

Calls 3

getIndexOfFunction · 0.85
indexOfFunction · 0.70
callMethod · 0.45

Tested by

no test coverage detected