Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/froebel/map.ts>default

A strictly typed utility library.
Go to Latest
variable default
import { default } from "https://deno.land/x/froebel@v0.18.0/map.ts";

Map over data. data can be a regular object, a Map, a Set, or an array.

Examples

Example 1

// -> { a: 1, b: 2 }
map({ a: '1', b: '2' }, (key, value) => [key, parseInt(value)])

Example 2

// -> Map([ [2, 1], [4, 3] ])
map(new Map([ [1, 2], [3, 4] ]), (key, value) => [key + 1, value - 1])

type

MapFun