CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes48downloads
intersection.js31 linesDownload Raw Back to lodash
1var arrayMap = require('./_arrayMap'),2    baseIntersection = require('./_baseIntersection'),3    baseRest = require('./_baseRest'),4    castArrayLikeObject = require('./_castArrayLikeObject');5 6/**7 * Creates an array of unique values that are included in all given arrays8 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)9 * for equality comparisons. The order and references of result values are10 * determined by the first array.11 *12 * @static13 * @memberOf _14 * @since 0.1.015 * @category Array16 * @param {...Array} [arrays] The arrays to inspect.17 * @returns {Array} Returns the new array of intersecting values.18 * @example19 *20 * _.intersection([2, 1], [2, 3]);21 * // => [2]22 */23var intersection = baseRest(function(arrays) {24  var mapped = arrayMap(arrays, castArrayLikeObject);25  return (mapped.length && mapped[0] === arrays[0])26    ? baseIntersection(mapped)27    : [];28});29 30module.exports = intersection;31 
basant307/AI_Governance_Project · CoolFace