- _map<T1, T2>(fn: (val: T1, index?: number, arr?: T1[]) => T2, arr: T1[]): T2[]
Parameters
- fn: (val: T1, index?: number, arr?: T1[]) => T2
- arr: T1[]
Returns T2[]
- _map<T1, T2>(
fn: (val: T1, key?: string, obj?: Record<string, T1>) => T2,
obj: Record<string, T1>,
): Record<string, T2> Parameters
- fn: (val: T1, key?: string, obj?: Record<string, T1>) => T2
- obj: Record<string, T1>
Returns Record<string, T2>
Change array or object by appling function to it's elements
For each element, provided function is called with element value, index/key and original container.