CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes45downloads
sample.js25 linesDownload Raw Back to lodash
1var arraySample = require('./_arraySample'),2    baseSample = require('./_baseSample'),3    isArray = require('./isArray');4 5/**6 * Gets a random element from `collection`.7 *8 * @static9 * @memberOf _10 * @since 2.0.011 * @category Collection12 * @param {Array|Object} collection The collection to sample.13 * @returns {*} Returns the random element.14 * @example15 *16 * _.sample([1, 2, 3, 4]);17 * // => 218 */19function sample(collection) {20  var func = isArray(collection) ? arraySample : baseSample;21  return func(collection);22}23 24module.exports = sample;25 
basant307/AI_Governance_Project · CoolFace