• Returns all of the values for the given path

    Example

    pluck([{a: {b: 1}}, {a: {b: 2}}, {a: {b: 3}}], 'a'); // [{b: 1}, {b: 2}, {b: 3}]
    

    Example

    pluck([{a: {b: 1}}, {a: {b: 2}}, {a: {b: 3}}], 'a.b'); // [1, 2, 3]
    

    Type Parameters

    • Value extends Record<string, unknown>

    • Path extends string

    Parameters

    • array: Value[]
    • path: Path

    Returns unknown[]

Generated using TypeDoc