English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Erlang Map keys Method

Erlang Map

This method is used to return all keys from the map.

Syntax

keys(map)

Parameters

  • map −This is the map that needs to return all keys.

Return Value

Return the list of keys in the map.

-module(helloworld). 
-export([start/0]). 
start() -> 
   Lst1 = [{"a",1},{"b",2},{"c",3}], 
   Map1 = maps:from_list(Lst1)), 
   io:fwrite("~p~n",[maps:keys(Map1)]).

Output Result

The output of the above program is as follows.

["a","b","c"]

Erlang Map