# index

## Syntax:
`index of {variable}`  
`index of {value} in [variable]`

## Examples:
`print the index of Values`  
``print the index of `apple` in Fruit` ``

## Description:
Returns the index currently set in the named variable. All variables are arrays, even when they only have a single element. The index is a pointer to which element should be accessed when using that variable. For a variable with only a single element this index is zero. See also the keywords [set](../keywords/set.md) and [index](../keywords/index).

The second form operates on a `{variable}` that holds a JSON array of data, returning the index of the first occurrence of `{value}`.

Next: [integer](integer.md)  
Prev: [hash](hash.md)

[Back](../../README.md)
