# Variables

Variable declaration looks like this:

```kotlin
var x = 42;
```

We can specify type of variable like this:

```kotlin
var x: int = 42;
```

### Zero initialized variables (undefined)

To create "undefined" variable you need use `undefined` keyword:

```kotlin
var x: int = undefined;
```

This code will allocate space in function stack for variable but doesn't initialize `x` with some value.

### Compile-time variables

Jazz allows you declare compile-time variable. You need use `comptime` keyword before `var`

```kotlin
comptime var x = 42;
```

You can't assign to `x` in non-compile-time context, you should use `comptime` keyword before assignment:

```kotlin
comptime x = 0;
```


---

# 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://jazz-lang.gitbook.io/jazz/variables.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.
