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

x/revoltio/deps.ts>Collection#map

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