Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/collection/src/Collection.ts>Collection#each

Utility data structure for Deno (Discord.js Collection).
Latest
method Collection.prototype.each
import { Collection } from "https://deno.land/x/collection@v1.0.1/src/Collection.ts";

Identical to Map.forEach(), but returns the collection instead of undefined.

Examples

collection .each(user => console.log(user.username)) .filter(user => user.bot) .each(user => console.log(user.username));

Parameters

fn: (
value: V,
key: K,
collection: this,
) => void

Function to execute for each element

Parameters

fn: (
this: T,
value: V,
key: K,
collection: this,
) => void
thisArg: T