Erlang - values


Advertisements

This method is used to return all the values from a map.

Syntax

values(map)

Parameters

  • map1 − This is the map for which all the values need to be returned.

Return Value

Returns the list of values from the map.

For example

-module(helloworld). 
-export([start/0]). 

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

Output

The output of the above program is as follows −

[1,2,3]
erlang_maps.htm
Advertisements