(key: string): any
(key: integer): any
(all: boolean): any
(arguments: {
all?: boolean,
key?: string | integer,
default?: any
}): anyThe _index operator gets a value from the list indices array of a block. The list indices array is an array of the indices of all list block areas which the block is a part of.
Arguments
integer
If the _index operator is called with a integer argument, the value at that index in the indices array is returned. If the value is not found, null is returned..
string
If the _args operator is called with a string argument, the value at that index in the indices array is returned. If the value is not found, null is returned.
boolean
If the _index operator is called with boolean argument true, the entire indices array is returned.
object
all: boolean: Ifallis set totrue, the entireindicesarray is returned. One ofallorkeyare required.key: string | integer: The value of the index in theindicesarray is returned. If the value is not found,null, or the specified default value is returned. One ofallorkeyare required.default: any: A value to return if thekeyis not found inarguments. By default,nullis returned if a value is not found.
Examples
Get a index:
Assuming the block is in the fourth content area of a list block.
_index: 0Returns: 3
Get all indices:
Assuming two nested list blocks, with the block in the fourth content area of the first list block, and the first content area of the nested list block.
_index: trueReturns: [3, 0]
