{
"id": "fn-array-keys",
"dataComponent": "array",
"heading": {
"title": "keys",
"badges": ["Array"]
},
"synopsis": "Returns a str-array of all keys in a keyed array. If the input is not keyed, returns an empty array or raises an error (depending on usage).",
"codeBlocks": [
"extend(\"array\")\\n\\nsput( array:keys([ alpha:10, beta:20, gamma:42 ]) )\\n// => [\"alpha\", \"beta\", \"gamma\"]\\n\\n// If called on a non-keyed array, it typically returns [] or may raise an error in some builds."
],
"notes": [
"Takes exactly one argument, typically a KeyedArray (e.g. [someKey:\"value\", anotherKey:123]).",
"Returns a str-array of all the keys in that keyed array, in insertion order.",
"If you pass a normal int[], str[], or anything else, the result may be an empty array or an error (implementation-dependent)."
]
}