MCPcopy Index your code
hub / github.com/plotly/dash / arrayMap

Function arrayMap

components/dash-table/src/core/math/arrayZipMap.ts:1–14  ·  view source on GitHub ↗
(
    a1: T1[],
    fn: (d1: T1, i: number) => TR
)

Source from the content-addressed store, hash-verified

1export function arrayMap<T1, TR>(
2 a1: T1[],
3 fn: (d1: T1, i: number) => TR
4): TR[] {
5 const _a1_ = a1.length;
6
7 const res: TR[] = new Array<TR>(_a1_);
8
9 for (let i = 0; i < _a1_; ++i) {
10 res[i] = fn(a1[i], i);
11 }
12
13 return res;
14}
15
16export function arrayMap2<T1, T2, TR>(
17 a1: T1[],

Callers 1

FilterFactoryClass · 0.90

Calls 1

fnFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…