# Partial Application

It is a way for us to partially apply a function. Well, it means taking a function applying some of its arguments into the function, so it remembers those parameters and then it uses closures to later on be called with all the rest of the arguments.

```javascript
const multiply = (a, b, c) => a * b * c;

const partialMultiplyBy5 = multiply.bind(null, 5);
partialMultiplyBy5(10, 2); // 100
partialMultiplyBy5(10); // NaN because the thrid params is undefined

const partialMultiplyBy50 = multiply.bind(null, 5, 10);
partialMultiplyBy50(2); // 100
partialMultiplyBy50(2, 10); //100 as the fourth params is ignored

```

That's the main difference between currying and partial application. Partial application expect all parameter on the second call. VS currying which expect one argument at one time.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://edsonha.gitbook.io/my-gitbook/object-oriented-programming-oop/functional-programming-fp/partial-application.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
