Skip to content

List Zipmap

The list::zipmap function creates a map by combining two lists: one for keys and one for values.

Syntax

list::zipmap(<keys>, <values>)

Parameters

  • keys: A list of keys for the map.
  • values: A list of values corresponding to the keys.

Returns

  • Map: A map where each key is paired with its corresponding value.

Example

Try it out below!
list::zipmap(["name", "age", "city"], ["Alice", 30, "New York"])

This function is useful for constructing maps from separate lists of keys and values, enabling structured data generation.