Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/revoltio/deps.ts>Collection#each

No-nonsense Revolt library for nodejs and deno.
Latest
method Collection.prototype.each
import { Collection } from "https://deno.land/x/revoltio@v1.0.0/deps.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