{
"id": "fn-array-intersection",
"dataComponent": "array",
"heading": {
"title": "intersection",
"badges": ["Array", "PARTIAL"]
},
"synopsis": "Returns an array of elements present in both input arrays. Supports partial usage.",
"codeBlocks": [
"extend(\"array\")\n\nsput( array:intersection([1,2,3,4], [2,4,6]) )\n# => [2,4]\n\n# Partial usage:\npart = array:intersection([5,6,7])\nsput( part([7,8,5]) )\n# => [5,7]\n\n# Placeholder usage:\npart2 = array:intersection(_, [10,11])\nsput( part2([11,12,13]) )\n# => [11]"
],
"notes": [
"Elements are compared by value and must be of comparable types.",
"The order of result matches the first array.",
"Partial usage is supported for either argument."
]
}