Skip to content

Intrinsic function: States.ArrayGetItem #474

@meenahoda

Description

@meenahoda

States.ArrayGetItem

Description from https://states-language.net/#appendix-b

This intrinsic function returns a specified index's value. This function takes two arguments. The first argument is an array of values and the second argument is the array index of the value to return.

For example, use the following inputArray and index values:

json { "inputArray": [1,2,3,4,5,6,7,8,9], "index": 5 }

From these values, you can use the States.ArrayGetItem function to return the value in the index position 5 within the array:

json "item.$": "States.ArrayGetItem($.inputArray, $.index)"

In this example, States.ArrayGetItem would return the following result:

json { "item": 6 }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions