> For the complete documentation index, see [llms.txt](https://javascript-1.gitbook.io/javascript/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://javascript-1.gitbook.io/javascript/fp/currying.md).

# Currying

Currying is a technique of translating the evaluation of a function that takes multiple arguments.

```javascript
Ex:
// Basic
const multiply = (a, b) => a*b;
multiply(3, 4); // 12

// currying
const curriedMultiply = (a) => (b) => a * b;
curriedMultiply(3)(4); // 12
```

Currying is useful for creating multiple utility functions.

```javascript
Ex:
const curriedMultiply = (a) => (b) => a * b;
const multiplyBy5 = curriedMultiply(5);
multiplyBy5(4) // 20
```

Instead of running the same code multiple times, i can now run the first part code once and second part code for usability times;
