Options
All
  • Public
  • Public/Protected
  • All
Menu

Module array/pluck

Index

References

Functions

References

Renames and re-exports pluck

Functions

  • pluck<P, T>(p: P, list: ArrayLike<Record<P, T>>): T[]
  • pluck<P>(p: P): <T>(list: ArrayLike<Record<P, T>>) => T[]
  • Returns a new list by plucking the same named property off all objects in the list supplied.

    example
     pluck('a')([{a: 1}, {a: 2}]); //=> [1, 2]
    pluck(0)([[1, 2], [3, 4]]); //=> [1, 3]

    Type parameters

    • P: string | number | symbol

    • T

    Parameters

    • p: P
    • list: ArrayLike<Record<P, T>>

    Returns T[]

    The list of values for the given key.

  • Returns a new list by plucking the same named property off all objects in the list supplied.

    example
     pluck('a')([{a: 1}, {a: 2}]); //=> [1, 2]
    pluck(0)([[1, 2], [3, 4]]); //=> [1, 3]

    Type parameters

    • P: string | number | symbol

    Parameters

    • p: P

    Returns <T>(list: ArrayLike<Record<P, T>>) => T[]

    The list of values for the given key.

      • <T>(list: ArrayLike<Record<P, T>>): T[]
      • Type parameters

        • T

        Parameters

        • list: ArrayLike<Record<P, T>>

        Returns T[]

Generated using TypeDoc