VOOZH about

URL: https://www.geeksforgeeks.org/javascript/lodash-_-curry-method/

⇱ Lodash _.curry() Method - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Lodash _.curry() Method

Last Updated : 3 Sep, 2024

Lodash _.curry() method returns a curried version of the given function. it accepts an arity which is a number that shows it will keep accepting arguments until it has received this number of arguments or invocings.

Syntax:

_.curry(fun, [arity=fun.length])

Parameters:

  • fun: This is the given function.
  • [arity=fun.length]: The arity of the function

Return Value:

  • It returns a curried version of the function.

Example 1: In this example, we are passing numbers to the gfgFunc which stores the result of the lodash _.curry method and prints the result in the console.

Output:

Addition is : 115
[Function: wrapper]

Example 2: In this example, we are passing numbers to the gfgFunc which stores the result of the lodash _.curry method and prints the result in the console.

Output: 

Multiplication is : 12420
[Function: wrapper]
Comment