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

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

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

Maps each item to another value into a collection. Identical in behavior to Array.map().

Examples

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

Parameters

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

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

Parameters

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