{
"id": "fn-math-plus",
"dataComponent": "math",
"heading": {
"title": "plus",
"badges": [
"Arithmetic",
"PARTIAL"
]
},
"synopsis": "Adds an integer (or array of integers) to another integer or array. Supports partial usage and underscore placeholders.",
"codeBlocks": [
"extend(\"math\")\\n\\n# Straight usage\\nsput( math:plus(3, 4) ) // => 7\\n\\n# Partial usage\\nplusTen = math:plus(10)\\nsput( plusTen(5) ) // => 15\\n\\n# Placeholder usage => skip the first parameter\\nplusTwo = math:plus(_, 2)\\nsput( plusTwo(10) ) // => 12\\n\\n# Arrays => second argument can be [10,20,30]\\nsput( math:plus(5, [10,20,30]) ) // => [15,25,35]\\n"
],
"notes": [
"When both arguments are single integers, the result is a single integer (e.g. 3 + 4 = 7).",
"If one argument is an integer array, the result is an integer array of element-wise sums (e.g. plus(5, [10,20,30]) -> [15,25,35]).",
"You can partially apply `plus` by supplying only one argument. For example, `plus(10)` returns a new function expecting the second argument.",
"Use the underscore placeholder (`_`) if you need to omit the first parameter instead of the second (e.g. `plus(_, 2)`)."
]
}