Skip to main content

$$at

Returns the value of an array at a specific index.

Usage​

{
"$$at": [ /* values */ ],
"index": -1
}
"$$at(<index>):{input}"

Returns​

Same as value at specified index

Arguments​

ArgumentTypeValuesRequired / Default ValueDescription
PrimaryarrayYesArray of elements
indexnumberPositive or negative integersYesThe index of element to return, negative indices will return element from the end (-n -> length - n)

Examples​

Input

Definition

Output

[1, 2, 4, 8]
{ 
"$$at": "$",
"index": 1
}
1
[1, 2, 4, 8]
{ 
"$$at": "$",
"index": -1
}
8
[1, 2, 4, 8]
"$$at(2):$"
4
[1, 2, 4, 8]
"$$at($[0]):$"
2