import { map } from "https://deno.land/x/core_fn@v1.0.0-beta.16/uncurry/common/map.ts";
Calls a defined callback function on each element of an array, and returns an array that contains the results.
Examples
Example 1
Example 1
map(() => 1, [1, 2, 3]) // [1, 1, 1]
map((a) => a + 1, new Unit8Array([2, 4, 6])) // Uint8Array(2) [3, 5, 7]
type
<T extends TypedArray | readonly unknown[]>(callbackfn: () => T[number], val: T) => T extends unknown[] ? Exclude<T, TypedArray> : Exclude<T, unknown[]>
value: T[number],
index: number,
array: T,