English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
This method is used to add key-value pairs to the map.
put(key1,value1,map1)
key1 −This is the key that needs to be added to the map.
Value1 −This is the key1Associated values that need to be added to the map.
map1 −This is the map that needs to add keys.
Original map with added keys.
-module(helloworld). -export([start/0]). start() -> Lst1 = [{"a",1},{"b",2},{"c",3}], Map1 = maps:from_list(Lst1, io:fwrite("~p~n",[maps:put("d",4,Map1)).
Output Result
The output of the above program is as follows-
#{"a" => 1,"b" => 2,"c" => 3,"d" => 4}