> For the complete documentation index, see [llms.txt](https://katxupa.gitbook.io/katxupa/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://katxupa.gitbook.io/katxupa/get-a-taste-of-katxupa/usage/scope-functions/functions/applyit.md).

# applyIt

***applyIt(function(){** // do something here with this **})***

* **The context object** is available as a receiver (this).
* **The return value** is the object itself.

As *applyIt* returns the context object itself, we recommend that you use it for code blocks that don't return a value and that mainly operate on the members of the receiver object. The most common use case for *applyIt* is for object configuration. Such calls can be read as "**apply the following assignments to the object.**"

```ts
const manuel = {name: "Manuel", age: 36};

manuel.applyIt(function () {
    this.name = "Manuel Santos";
    this.age++;
    (this as any)["country"] = "Portugal";
});
console.log(manuel)
```

Another use case for *applyIt* is to include *applyIt* in multiple call chains for more complex processing.
