# Functions

## Declare a function

## Arrow functions (lambda)

Like JavaScript or C#, but our functions have no "**this**", so arrow function is a short way to create a function.

```javascript
var add = (a, b) => a + b
puts add(4, 5)    // 9
```

{% hint style="info" %}
Summary:

* **func** keyword helps you declare a function in top-level of code.
* Arrow function creates a function as an expression.
  {% endhint %}

## Closures & bindings

We have an example, a counting program:

```go
var count = 0

func increase() {
    count++
}

func decrease() {
    count--
}
```

The **count** variable is binded in two functions, **increase()** and **decrease()**. When we call one of them, the value of **count** will be modified.


---

# 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://aup.nomi.dev/the-language/types-and-values/functions.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.
