Skip to main content
variable map
import { map } from "https://deno.land/x/30_seconds_of_typescript@v1.0.1/util.ts";

Creates a new map with the results of calling a provided function on every value in the calling function.

Use Array.isArray() to detect array, else destructure array like data(string). Use Array.prototype.map() to map array of data.

type

<T = any>(array: Iterable<T>, fn: MapFunc<T>) => unknown