• Creates an object with keys and values generated by running the provided function for each value

    Example

    const users = {
    fred: { user: "fred", age: 40 },
    pebbles: { user: "pebbles", age: 1 }
    };
    map(users, u => u.age); // { fred: 40, pebbles: 1 }

    Type Parameters

    • T extends Record<string, unknown>

    • K extends string | number | symbol

    Parameters

    • obj: T
    • fn: ((value: T[K], key: K, object: T) => Record<string, unknown>)
        • (value: T[K], key: K, object: T): Record<string, unknown>
        • Parameters

          • value: T[K]
          • key: K
          • object: T

          Returns Record<string, unknown>

    Returns Record<string, unknown>

Generated using TypeDoc