Skip to main content

lookup Function

lookup retrieves the value of a single element from a map, given its key. If the given key does not exist, the given default value is returned instead.

Code Block
lookup(map, key, default)

Examples

Code Block
> lookup({a="ay", b="bee"}, "a", "what?")
ay
> lookup({a="ay", b="bee"}, "c", "what?")
what?
  • element retrieves a value from a list given its index.