# Defining Variables

In OSL when you define a variable it will always be global scoped. This means the variable can be accessed from anywhere in your program including inside of defined functions.&#x20;

```javascript
variable = 10
```

Variables cannot be defined anywhere other than directly at the start of a line and using an equals sign.

If you attempt to access a variable that has not been defined yet, it will return the variable name as an untyped value.

```javascript
log undefined_variable
// logs undefined_variable to the console with no quoteation marks.
```


---

# 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://osl.mistium.com/basics/defining-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.
