{
"id": "fn-array-each",
"dataComponent": "array",
"heading": {
"title": "each",
"badges": [
"Array",
"PARTIAL",
"Effect"
]
},
"synopsis": "Applies a function to each item in an array for side effects and returns the original array unchanged.",
"codeBlocks": [
"extend(\"array\")\n\n# Straight usage\narray:each(sput, [1,2,3])\n// returns [1,2,3]\n// outputs 123\n\n# Partial usage\nprintAll = array:each(sput)\nprintAll([4,5,6])\n// outputs 456\n\n# Placeholder partial usage\nrunner = array:each(_, [\"A\",\"B\"])\nrunner(sput)\n// outputs AB\n\n"
],
"notes": [
"Similar to array:map but calls the function for the purpose of side effects, then returns the original array as-is."
]
}