Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE] add foreach expression for arrays
- Loading branch information
1 parent
2d5499b
commit 0a20621
Showing
4 changed files
with
132 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"name": "array_foreach", | ||
"type": "function", | ||
"description": "Returns an array with the given expression evaluated on each item.", | ||
"arguments": [ | ||
{"arg":"array","description":"an array"}, | ||
{"arg":"expression","description":"an expression to evaluate on each item. The variable `@element` will be replaced by the current value."} | ||
], | ||
"examples": [ | ||
{ "expression": "array_foreach(array('a','b','c'),upper(@element))", "returns":"array: 'A', 'B', 'C'"}, | ||
{ "expression": "array_foreach(array(1,2,3),@element + 10)", "returns":"array: 11, 12, 13"} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters