• Creates an object composed of keys generated from the results of running each element of collection thru iteratee. The corresponding value of each key is the last element responsible for generating the key.

    Contribution to minified bundle size, when it is the only function imported:

    • Lodash: 16,606 bytes
    • Micro-dash: 305 bytes

    Type Parameters

    • T
    • K extends PropertyKey

    Parameters

    • array: Nil | readonly T[]
    • iteratee: ValueIteratee<T, K>

    Returns IfIndexType<K, {
        [key in K]: T
    }, {
        [key in K]?: T
    }>

  • Type Parameters

    • T
    • K extends PropertyKey

    Parameters

    • object: Nil | T
    • iteratee: ValueIteratee<T[keyof T], K>

    Returns IfIndexType<K, {
        [key in K]: T[keyof T]
    }, {
        [key in K]?: T[keyof T]
    }>