D3.js | d3.map.values() Function Last Updated : 28 Jun, 2019 Comments Improve Suggest changes Like Article Like Report The map.values() function in D3.js used to return an array of values for every entry in the created map. The order of the returned values are arbitrary. Syntax: d3.map.values() Parameters: This function does not accept any parameters. Return Value: This function returns an array of values for every entry in the created map. Order of those returned values are arbitrary. Below programs illustrate the d3.map.values() function in D3.js: Example 1: javascript <!DOCTYPE html> <html> <head> <title> d3.map.values() Function</title> <script src='https://d3js.org/d3.v4.min.js'></script> </head> <body> <script> // Creating a map var map = d3.map({"Ram": 5, "Geeks": 10, "gfg": 15}); // Calling the map.values() function A = map.values(); // Getting an array of values for // every entry in the map. console.log(A); </script> </body> </html> Output: [5, 10, 15] Example 2: javascript <!DOCTYPE html> <html> <head> <title> d3.map.values() Function</title> <script src='https://d3js.org/d3.v4.min.js'></script> </head> <body> <script> // Creating some maps var map1 = d3.map({"Ram": 5}); var map2 = d3.map({"Geeks": 10}); var map3 = d3.map({"Ram": 5, "Geeks": 10}); var map4 = d3.map(); // Calling the map.values() function A = map1.values(); B = map2.values(); C = map3.values(); D = map4.values(); // Getting an array of values for // every entry in the map. console.log(A); console.log(B); console.log(C); console.log(D); </script> </body> </html> Output: [5] [10] [5, 10] [] Ref: https://devdocs.io/d3~5/d3-collection#map_values Comment More infoAdvertise with us Next Article D3.js | d3.map.values() Function K Kanchan_Ray Follow Improve Article Tags : JavaScript Web Technologies D3.js Similar Reads D3.js | d3.values() Function The d3.values() function in D3.js is used to return an array containing the property values of the specified object or an associative array. Syntax: d3.values(object) Parameters: This function accepts single parameter object which contains the key, value pairs. Return Value: It returns the values of 1 min read D3.js | d3.set.values() Function The set.values() function in D3.js is used to return an array of the string values in the set. This function can be used for computing the unique values for a set of strings. Syntax: d3.set([Array]).values(); Parameters: This function accepts a parameter Array of strings. Return Value: It returns th 2 min read 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. Syntax: d3.map.set(key, value); 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 st 2 min read D3.js | d3.map.remove() Function The map.remove() function is an inbuilt function in D3.js. If the created map contains the given key string then it removes the entry and returns true. If key string not presents then it returns false. Syntax: map.remove(key) Parameters: This function accepts single parameter key which is used to sp 2 min read D3.js | d3.map.size() Function The map.size() function in D3.js is used to return the number of entries in the created map. Syntax: map.size() Parameters: This function does not accept any parameters. Return Value: This function returns the number of entries in the created map. Below programs illustrate the d3.map.size() function 1 min read Like