Function mapObject

  • Creates an array of values by running each property of object thru iteratee. The iteratee is invoked with three arguments: (value, key, object).

    Type Parameters

    • T extends object
    • S

    Parameters

    • object: T

      The object to iterate over.

    • iteratee: ObjectIterator<T, S>

      The function invoked per iteration.

    Returns S[]

    Returns the new mapped array.

    5.0.0

    function square(n) {
    return n * n
    }

    map({ 'a': 4, 'b': 8 }, square)
    // => [16, 64] (iteration order is not guaranteed)