CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes48downloads
array.js21 linesDownload Raw Back to src
1export default function(x) {2  return typeof x === "object" && "length" in x3    ? x // Array, TypedArray, NodeList, array-like4    : Array.from(x); // Map, Set, iterable, string, or anything else5}6 7export function shuffle(array, random) {8  let m = array.length,9      t,10      i;11 12  while (m) {13    i = random() * m-- | 0;14    t = array[m];15    array[m] = array[i];16    array[i] = t;17  }18 19  return array;20}21 
basant307/AI_Governance_Project · CoolFace