Array Add to End
array.push arrayVariable {
value = 10
}
| Parameter | Purpose | Example |
|---|---|---|
| arrayVariable | This is the array variable you want to target with the array operation | arrayVariable |
| value | The value you want to apply to the array operation | 5 |
Example
Example
array.push arrayVariable {
value = 10
}

Array Add to Beginning
array.unshift arrayVariable {
value = 10
}
| Parameter | Purpose | Example |
|---|---|---|
| arrayVariable | This is the array variable you want to target with the array operation | arrayVariable |
| value | The value you want to apply to the array operation | 5 |
Example
Example
array.unshift arrayVariable {
value = 10
}

Array Remove From End Of
array.pop arrayVariable as removedElement
| Parameter | Purpose | Example |
|---|---|---|
| arrayVariable | This is the array variable you want to target with the array operation | arrayVariable |
| removedElement | The variable you want to store the removed item in | removedElement |
Example
Example
array.pop arrayVariable as removedElement

Array Remove From Beginning Of
array.shift arrayVariable as removedElement
| Parameter | Purpose | Example |
|---|---|---|
| arrayVariable | This is the array variable you want to target with the array operation | arrayVariable |
| removedElement | The variable you want to store the removed item in | removedElement |
Example
Example
array.shift arrayVariable as removedElement

Array Merge
array.merge arrayVariable {
value = $anotherArrayVariable
}
| Parameter | Purpose | Example |
|---|---|---|
| arrayVariable | This is the variable that contains the first array you want to merge. | arrayVariable |
| value | This is the second array that you want to merge. It could be a hardcoded array or from a variable. | [1,2,3,4,5] $anotherArrayVariable |
Example
Example
array.merge arrayVariable {
value = $anotherArrayVariable
}

Find First Element In
array.find ($arrayVariable) if (`$this == 1`) as foundElement
| Parameter | Purpose | Example |
|---|---|---|
| $arrayVariable | This is the variable that contains the array you want to find the element in. | $arrayVariable |
| if | This is where you define the conditions of the element you want to find. Use $this to represent each individual item in the array. | if (`$this == 1`) |
| as | The variable that you want to store the found element | foundElement |
Example
Example
array.find ($arrayVariable) if (`$this == 1`) as foundElement


Find First Element Index In
array.find_index ($arrayVariable) if (`$this == 1`) as foundElement
| Parameter | Purpose | Example |
|---|---|---|
| $arrayVariable | This is the variable that contains the array you want to find the element in. | $arrayVariable |
| if | This is where you define the conditions of the element you want to find. Use $this to represent each individual item in the array. | if (`$this == 1`) |
| as | The variable that you want to store the index of found element | foundElement |
Example
Example
array.find_index ($arrayVariable) if (`$this == 1`) as foundElement


Has Any Element
array.has ($arrayVariable) if (`$this == 1`) as foundElement
| Parameter | Purpose | Example |
|---|---|---|
| $arrayVariable | This is the variable that contains the array you want to find the element in. | $arrayVariable |
| if | This is where you define the conditions of the element you want to find. Use $this to represent each individual item in the array. | if (`$this == 1`) |
| as | The variable that you want to store the index of found element | foundElement |
Example
Example
array.has ($arrayVariable) if (`$this == 1`) as foundElement


Has Every Element
array.every ($arrayVariable) if (`$this == 1`) as elementExists
| Parameter | Purpose | Example |
|---|---|---|
| $arrayVariable | This is the variable that contains the array you want to find the element in. | $arrayVariable |
| if | This is where you define the conditions of the element you want to find. Use $this to represent each individual item in the array. | if (`$this == 1`) |
| as | The variable that you want to store the result | foundElement |
Example
Example
array.every ($arrayVariable) if (`$this == 1`) as elementExists


Find All Elements
array.filter ($arrayVariable) if (`$this == 1`) as allFoundElements
| Parameter | Purpose | Example |
|---|---|---|
| $arrayVariable | This is the variable that contains the array you want to find the element in. | $arrayVariable |
| if | This is where you define the conditions of the element you want to find. Use $this to represent each individual item in the array. | if (`$this == 1`) |
| as | The variable that you want to store all of the found elements | allFoundElements |
Example
Example
array.filter ($arrayVariable) if (`$this == 1`) as allFoundElements


Get Element Count
array.filter_count ($arrayVariable) if (`$this == 1`) as allFoundElements
| Parameter | Purpose | Example |
|---|---|---|
| $arrayVariable | This is the variable that contains the array you want to find the element in. | $arrayVariable |
| if | This is where you define the conditions of the element you want to find. Use $this to represent each individual item in the array. | if (`$this == 1`) |
| as | The variable that you want to store the count of all of the found elements | allFoundElements |
Example
Example
array.filter_count ($arrayVariable) if (`$this == 1`) as allFoundElements


Map (Transform Each Element)
array.map ($arrayVariable) as mappedArray {
value = $this * 2
}
| Parameter | Purpose | Example |
|---|---|---|
| $arrayVariable | The array to map over. | $arrayVariable |
| as | The variable to store the mapped array. | mappedArray |
| value | The expression to apply to each element. $this refers to the current element. | $this * 2 |
Example
Example
array.map ($arrayVariable) as mappedArray {
value = $this * 2
}
Partition (Split by Condition)
array.partition ($arrayVariable) if (`$this > 0`) as $partitioned
| Parameter | Purpose | Example |
|---|---|---|
| $arrayVariable | The array to partition. | $arrayVariable |
| if | The condition to split the array. $this is the current element. | $this > 0 |
| as | The variable to store the result (object with true and false keys). | $partitioned |
Example
Example
array.partition ($arrayVariable) if (`$this > 0`) as $partitioned
Group By (Organize by Key)
array.group_by ($arrayVariable) as $grouped {
key = $this.category
}
| Parameter | Purpose | Example |
|---|---|---|
| $arrayVariable | The array to group. | $arrayVariable |
| as | The variable to store the grouped result. | $grouped |
| key | The key to group by (expression using $this). | $this.category |
Example
Example
array.group_by ($arrayVariable) as $grouped {
key = $this.category
}
Difference (Array Diff)
array.diff $arrayA $arrayB as $diffResult
| Parameter | Purpose | Example |
|---|---|---|
| $arrayA | The array to subtract from. | $arrayA |
| $arrayB | The array of values to remove. | $arrayB |
| as | The variable to store the result. | $diffResult |
Example
Example
array.diff $arrayA $arrayB as $diffResult
Intersection (Array Intersect)
array.intersect $arrayA $arrayB as $intersectResult
| Parameter | Purpose | Example |
|---|---|---|
| $arrayA | The first array. | $arrayA |
| $arrayB | The second array. | $arrayB |
| as | The variable to store the result. | $intersectResult |
Example
Example
array.intersect $arrayA $arrayB as $intersectResult
Union (Unique Merge)
array.union $arrayA $arrayB as $unionResult
| Parameter | Purpose | Example |
|---|---|---|
| $arrayA | The first array. | $arrayA |
| $arrayB | The second array. | $arrayB |
| as | The variable to store the result. | $unionResult |
Example
Example
array.union $arrayA $arrayB as $unionResult