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

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

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

Maps each item to another value into an array. Identical in behavior to Array.map().

Examples

collection.map(user => user.tag);

Parameters

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

Function that produces an element of the new array, taking three arguments

Parameters

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