• Creates a function that accepts up to one argument, ignoring any additional arguments.

    Type Parameters

    • T

    • TResult

    Parameters

    • func: ((arg1, ...args) => TResult)

      The function to cap arguments for.

        • (arg1, ...args): TResult
        • Parameters

          • arg1: T
          • Rest ...args: any[]

          Returns TResult

    Returns ((arg1) => TResult)

    Returns the new function.

      • (arg1): TResult
      • Creates a function that accepts up to one argument, ignoring any additional arguments.

        Parameters

        • arg1: T

        Returns TResult

        Returns the new function.

        Category

        Function

        Example

        _.map(['6', '8', '10'], _.unary(parseInt));
        // => [6, 8, 10]

    Example

    _.map(['6', '8', '10'], _.unary(parseInt));
    // => [6, 8, 10]

Generated using TypeDoc