15 lines
594 B
Plaintext
Raw Normal View History

{
"name": "array_foreach",
"type": "function",
2020-07-02 01:46:48 +01:00
"groups": ["Arrays"],
"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": [
2018-08-24 14:04:27 +02:00
{ "expression": "array_foreach(array('a','b','c'),upper(@element))", "returns":"[ 'A', 'B', 'C' ]"},
{ "expression": "array_foreach(array(1,2,3),@element + 10)", "returns":"[ 11, 12, 13 ]"}
]
}