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

x/collection/src/Collection.ts>default#tap

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

Runs a function on the collection and returns the collection.

Examples

collection .tap(coll => console.log(coll.size)) .filter(user => user.bot) .tap(coll => console.log(coll.size))

Parameters

fn: (collection: this) => void

Function to execute

Parameters

fn: (this: T, collection: this) => void
thisArg: T