Options
All
  • Public
  • Public/Protected
  • All
Menu

Module property

Index

References

Functions Util

References

Renames and re-exports property

Util Functions

  • property(path: ArrayPath): Accessor
  • Creates a function that returns the value at path of a given object.

    since

    5.0.0

    example
    const objects = [
    { 'a': { 'b': 2 } },
    { 'a': { 'b': 1 } }
    ]

    map(objects, property('a.b'))
    // => [2, 1]

    map(sortBy(objects, property(['a', 'b'])), 'a.b')
    // => [1, 2]

    Parameters

    • path: ArrayPath

      The path of the property to get.

    Returns Accessor