# VALUE\_OF

**The function VALUE\_OF takes a variable of any data type and returns its value.**

This function takes as single variable of any [data type](../../variable-data-types/data-types-overview) as input. It returns the value of the given variable.&#x20;

#### Declaration

```javascript
VALUE_OF(input) -> input_value
```

&#x20;

#### Parameters

**input** (required, type: _any_) A variable of any data type.

#### Return Values

**input\_value** (type: _any_) The value of the variable given as input.

#### Examples

The VALUE\_OF function must be given a variable as input. Hardcoding input will cause it to throw an error, as in the following example:

```javascript
VALUE_OF(3) -> ERROR
```

Assume all subsequent examples have access to the following variable, **example\_number**:

```javascript
example_number = 3
```

Giving **example\_number** as input to the function VALUE\_OF causes it to output the number 3:

```javascript
VALUE_OF(example_number) -> 3
```

The function VALUE\_OF accepts all data types as input, including [Lists](../../variable-data-types/the-list-data-type) and [App Objects](../../working-with-data/airdata/airdata-app-objects), which themselves might contain different types of data. For instance, assume all subsequent examples have access to the following variable, **example\_object**. Note that **example\_object** had two properties: "number", and "name", the values of which are a [Number](../../variable-data-types/the-number-variable-data-type) and a [text](../../variable-data-types/the-text-variable-data-type) data type, respectively:

```javascript
example_object = {  
 "number": 3,  
 "name": "Alice"  
}
```

The relatively complexity of **example\_object** does not prevent VALUE\_OF from returning the value it contains when given **example\_object**as input:

```javascript
VALUE_OF(example_object) -> {  
 "number": 3,  
 "name": "Alice"  
}
```

#### Discussion

In the vast majority of cases when the value of a variable is needed, it can be accessed simply by calling on the variable itself. That is, given some variable **example**:

```javascript
VALUE_OF(example) = example
```

In these cases, use of the function VALUE\_OF is unnecessary. This is because, by default, variables in Airkit are `writable`.

However, under very particular circumstances, such as when working with Custom Controls, a variable might be `readOnly` when a  `writable` variable is needed. Giving a `readOnly` variable as input to VALUE\_OF returns a value that can be saved as a `writable` variable.
