> For the complete documentation index, see [llms.txt](https://learn.fi-code.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learn.fi-code.com/overview/variable-modifiers.md).

# Variable Modifiers

Variable modifiers allow you to work directly with a variable, making your code look more logical and easier to follow, as well as taking less time to type out. A variable modifier would look like this:

**\<variable>.\<modifier>(\<arguments>);**

```
let int n1 = int 1;
n1 = add(n1, int 3); # n1 = 4

# We can use a variable modifier here instead
let int n2 = int 1;
n2.add(int 3); // n2 = 4
```

Variable modifiers still execute the original functions (i.e. the above is using the add() function), although **we drop the first argument** of the function and ensure all other arguments are provided.

In some cases, variable modifiers will also store the result directly to the original variable as well, therefore the following is invalid:

```
let int n1 = 1;
let int n2 = n1.add(int 3); // Error - n1 = 4, n2 = compile error

//Instead you would do the following
let int n1 = 1;
let int n2 = add(n1, int 3); // n1 = 1, n2 = 4
```

The following [functions](/overview/functions.md) are acceptable variable modifiers (ensure the types are correct):

* **add**
* **sub**
* **mul**
* **concat**
* **mod**
* **div**
* **length**
* **get**
* **pop**
* **drop**
* **in**
* **push**


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://learn.fi-code.com/overview/variable-modifiers.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
