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

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

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

Maps each item into a Collection, then joins the results into a single Collection. Identical in behavior to Array.flatMap().

Examples

collection.flatMap(guild => guild.members.cache);

Parameters

fn: (
value: V,
key: K,
collection: this,
) => Collection<K, T>

Function that produces a new Collection

Parameters

fn: (
this: This,
value: V,
key: K,
collection: this,
) => Collection<K, T>
thisArg: This