{
"id": "fn-array-zip",
"dataComponent": "array",
"heading": {
"title": "zip",
"badges": ["Array", "PARTIAL"]
},
"synopsis": "Combines two arrays into an array of pairs (tuples). Supports partial usage and placeholders.",
"codeBlocks": [
"extend(\"array\")\n\n# 1) Zipping two arrays:\nsput( array:zip([1,2,3], [4,5,6]) )\n# => [[1,4],[2,5],[3,6]]\n\n# 2) Partial usage:\nzipA = array:zip([10,20])\nsput( zipA([100,200]) )\n# => [[10,100],[20,200]]\n\n# 3) Placeholder usage:\nzipTail = array:zip(_, [\"a\",\"b\"])\nsput( zipTail([\"x\",\"y\"]) )\n# => [[\"x\",\"a\"],[\"y\",\"b\"]]"
],
"notes": [
"Accepts up to two arrays of equal length (int[], str[], etc).",
"Returns an array where each item is a 2-element array (the paired elements).",
"If arrays differ in length, result is truncated to the shorter array.",
"Partial usage and _ placeholders are supported."
]
}