CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes48downloads
zipWith.js33 linesDownload Raw Back to lodash-es
1import baseRest from './_baseRest.js';2import unzipWith from './unzipWith.js';3 4/**5 * This method is like `_.zip` except that it accepts `iteratee` to specify6 * how grouped values should be combined. The iteratee is invoked with the7 * elements of each group: (...group).8 *9 * @static10 * @memberOf _11 * @since 3.8.012 * @category Array13 * @param {...Array} [arrays] The arrays to process.14 * @param {Function} [iteratee=_.identity] The function to combine15 *  grouped values.16 * @returns {Array} Returns the new array of grouped elements.17 * @example18 *19 * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {20 *   return a + b + c;21 * });22 * // => [111, 222]23 */24var zipWith = baseRest(function(arrays) {25  var length = arrays.length,26      iteratee = length > 1 ? arrays[length - 1] : undefined;27 28  iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;29  return unzipWith(arrays, iteratee);30});31 32export default zipWith;33 
basant307/AI_Governance_Project · CoolFace