2018-08-23 12:32:32 +10:00

14 lines
576 B
Plaintext

{
"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"}
]
}