Function ary

  • Creates a function that invokes func, with up to n arguments, ignoring any additional arguments.

    Parameters

    • func: Function

      The function to cap arguments for.

    • n: any = func.length

      The arity cap.

    • Optional guard: any

      Enables use as an iteratee for methods like map.

      Optional

    Returns Function

    Returns the new capped function.

    Since

    5.5.0

    Example

    map(['6', '8', '10'], ary(parseInt, 1));
    // => [6, 8, 10]