$$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​
Argument | Type | Values | Required / Default Value | Description |
---|---|---|---|---|
Primary | array | Yes | Array of elements | |
index | number | Positive or negative integers | Yes | The 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