CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes48downloads
pullAllWith.js33 linesDownload Raw Back to lodash
1var basePullAll = require('./_basePullAll');2 3/**4 * This method is like `_.pullAll` except that it accepts `comparator` which5 * is invoked to compare elements of `array` to `values`. The comparator is6 * invoked with two arguments: (arrVal, othVal).7 *8 * **Note:** Unlike `_.differenceWith`, this method mutates `array`.9 *10 * @static11 * @memberOf _12 * @since 4.6.013 * @category Array14 * @param {Array} array The array to modify.15 * @param {Array} values The values to remove.16 * @param {Function} [comparator] The comparator invoked per element.17 * @returns {Array} Returns `array`.18 * @example19 *20 * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];21 *22 * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);23 * console.log(array);24 * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]25 */26function pullAllWith(array, values, comparator) {27  return (array && array.length && values && values.length)28    ? basePullAll(array, values, undefined, comparator)29    : array;30}31 32module.exports = pullAllWith;33 
basant307/AI_Governance_Project · CoolFace