CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes48downloads
forEach.d.ts26 linesDownload Raw Back to set
1/**2 * Executes a provided function once for each element in a Set.3 *4 * This function iterates through all elements of the Set and executes the callback function5 * for each element. The callback receives the value twice (for consistency with Map.forEach)6 * and the Set itself as arguments.7 *8 * @template T - The type of elements in the Set.9 * @param {Set<T>} set - The Set to iterate over.10 * @param {(value: T, value2: T, set: Set<T>) => void} callback - A function to execute for each element.11 * @returns {void}12 *13 * @example14 * const set = new Set([1, 2, 3]);15 * forEach(set, (value) => {16 *   console.log(value * 2);17 * });18 * // Output:19 * // 220 * // 421 * // 622 */23declare function forEach<T>(set: Set<T>, callback: (value: T, value2: T, set: Set<T>) => void): void;24 25export { forEach };26 
basant307/AI_Governance_Project · CoolFace