Options
All
  • Public
  • Public/Protected
  • All
Menu

Module flip

Index

References

Functions Function

References

Renames and re-exports flip

Function Functions

  • flip<F>(func: F): ((...args: any[]) => ReturnType<F>)
  • Creates a function that invokes func with arguments reversed.

    since

    5.12.0

    see

    [[reverse]]

    example
    const flipped = flip((...args) => args)

    flipped('a', 'b', 'c', 'd')
    // => ['d', 'c', 'b', 'a']

    Type Parameters

    • F extends ((...args: any[]) => any)

    Parameters

    • func: F

      The function to flip arguments for.

    Returns ((...args: any[]) => ReturnType<F>)

    Returns the new flipped function.

      • (...args: any[]): ReturnType<F>
      • Creates a function that invokes func with arguments reversed.

        since

        5.12.0

        category

        Function

        see

        [[reverse]]

        example
        const flipped = flip((...args) => args)

        flipped('a', 'b', 'c', 'd')
        // => ['d', 'c', 'b', 'a']

        Parameters

        • Rest ...args: any[]

        Returns ReturnType<F>

        Returns the new flipped function.