{
"id": "fn-array-zipWith",
"dataComponent": "array",
"heading": {
"title": "zipWith",
"badges": ["Array", "PARTIAL"]
},
"synopsis": "Zips two arrays using a function to combine corresponding elements. Supports partial usage.",
"codeBlocks": [
"extend(\"array\")\n\nsput( array:zipWith((a,b)=>a+b, [1,2,3], [10,20,30]) )\n# => [11,22,33]\n\n# Partial usage:\naddZip = array:zipWith((a,b)=>a+b)\nsput( addZip([5,6], [7,8]) )\n# => [12,14]"
],
"notes": [
"The first argument is a function called with each pair of elements.",
"Arrays are zipped to the length of the shorter input.",
"Partial usage is allowed for function and/or arrays.",
"If types differ, bridging may error or upcast."
]
}