{
"id": "fn-array-findIndex",
"dataComponent": "array",
"heading": {
"title": "findIndex",
"badges": ["Array", "PARTIAL"]
},
"synopsis": "Returns the index of the first element matching a predicate. Returns -1 if not found. Supports partial usage and placeholders.",
"codeBlocks": [
"extend(\"array\")\n\narray:findIndex(x => x > 20, [4,8,15,16,23,42])\n// => 4\n\n# Partial usage:\nidxFinder = array:findIndex(x => x == 42)\nidxFinder([1,2,42])\n// => 2\n\n# Placeholder usage:\npartial = array:findIndex(_, [10,12,14])\npartial(x => x % 7 == 0)\n// => 2"
],
"notes": [
"Accepts up to two arguments: (predicateFn, array).",
"Returns index of first match, or -1 if not found.",
"Partial usage supported."
]
}