D3.js | d3.map.set() Function
The map.set() function in D3.js used to set the values for the specified key string in to the created map.
Parameters: This function accepts two parameters which are illustrated below:
- key: This is the key string.
- value: This is the corresponding value for each key string.
Return Value: This function does not return any values.
Below programs illustrate the d3.map.set() function in D3.js:
Note: In the above code, the string “c” is not present in the created map that is why undefined is printed as output.