Options
All
  • Public
  • Public/Protected
  • All
Menu

Module invoke

Index

Functions Object

Object Functions

  • invoke(object: any, path: any, ...args: any[]): any
  • Invokes the method at path of object.

    since

    5.7.0

    example
    const object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] }

    invoke(object, 'a[0].b.c.slice', [1, 3])
    // => [2, 3]

    Parameters

    • object: any

      The object to query.

    • path: any

      The path of the method to invoke.

    • Rest ...args: any[]

      The arguments to invoke the method with.

    Returns any

    Returns the result of the invoked method.