(key: string): any
(key: integer): any
(all: boolean): any
(arguments: {
all?: boolean,
key?: string | integer,
default?: any
}): any
The _args
operator gets a value from the arguments
array passed to a function operator. The arguments
array is an array of all the positional arguments passed to the function.
Arguments
string
If the _args
operator is called with a string argument, the value of the key in the arguments
array is returned. If the value is not found, null
is returned. Dot notation and block list indexes are supported.
integer
If the _args
operator is called with a integer argument, the value at that index in the arguments
array is returned. If the value is not found, null
is returned. Dot notation and block list indexes are supported.
boolean
If the _args
operator is called with boolean argument true
, the entire arguments
array is returned.
object
all: boolean
: Ifall
is set totrue
, the entirearguments
array is returned. One ofall
orkey
are required.key: string | integer
: The value of the key or index in thearguments
array is returned. If the value is not found,null
, or the specified default value is returned. Dot notation and block list indexes are supported. One ofall
orkey
are required.default: any
: A value to return if thekey
is not found inarguments
. By default,null
is returned if a value is not found.
Examples
Map over an array:
_array.map:
on:
- firstName: Ted
lastName: Mosby
- firstName: Robin
lastName: Scherbatsky
- firstName: Marshall
lastName: Eriksen
- firstName: Lily
lastName: Aldrin
- firstName: Barney
lastName: Stinson
callback:
_function:
__string.concat:
- __args: 0.firstName
- ' '
- __args: 0.lastName
Returns:
- Ted Mosby
- Robin Scherbatsky
- Marshall Eriksen
- Lily Aldrin
- Barney Stinson