CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes48downloads
shuffle.js26 linesDownload Raw Back to lodash-es
1import arrayShuffle from './_arrayShuffle.js';2import baseShuffle from './_baseShuffle.js';3import isArray from './isArray.js';4 5/**6 * Creates an array of shuffled values, using a version of the7 * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).8 *9 * @static10 * @memberOf _11 * @since 0.1.012 * @category Collection13 * @param {Array|Object} collection The collection to shuffle.14 * @returns {Array} Returns the new shuffled array.15 * @example16 *17 * _.shuffle([1, 2, 3, 4]);18 * // => [4, 1, 3, 2]19 */20function shuffle(collection) {21  var func = isArray(collection) ? arrayShuffle : baseShuffle;22  return func(collection);23}24 25export default shuffle;26 
basant307/AI_Governance_Project · CoolFace