MAP_KEYS Function
Overview
The MAP_KEYS
function is used to extract all the key values from the input map type data and return them in the form of an array.
Syntax
Parameters
- map: The input map data type, where K is the key type and V is the value type.
Return Value
Returns an array containing all the key values, of type array<K>
.
Example Usage
- Extract keys from a simple key-value map:
- Extract key from nested map:
- Extract key from an empty map:
Notes
- If the input map is empty, the
MAP_KEYS
function will return an empty array. - The
MAP_KEYS
function does not change the order of keys in the original map.