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 D3.js nest.map() Function nest.map() function in D3.js is used to form a nested map. The map contains a key-value pair determined by the key function which was executed very first. If no keys are declared or defined than map function returns the original array as it is. Syntax: nest.map(array) Parameters: It takes the collec 2 min read D3.js | d3.pairs() function The d3.pairs() function in D3.js is used to create pair of array elements from the given array elements. If the given array is having less than two elements then it returns the empty array. Syntax: d3.pairs(Array) Parameters: This function accepts a parameter Array whose elements are going to be pai 2 min read D3.js d3.max() function The d3.max() function in D3.js is used to return the maximum value in the given array using natural order. If an array is empty then it returns undefined as output. Syntax:d3.max(Array)Parameters:This function accepts parameters Array which is an array of elements whose maximum value is to be calcul 2 min read D3.js | d3.keys() Function The d3.keys() function in D3.js is used to return an array containing the property names or keys of the specified object or an associative array. Syntax: d3.keys(object) Parameters: This function accepts single parameter object containing key and value in pairs. Return Value: It returns the keys of 1 min read D3.js | d3.map.get() Function The map.get() function in D3.js is used to return the value for the specified key string. If the created map does not contain the specified key then it returns undefined. Syntax: map.get(key) Parameters: This function accepts single parameter key which is used to specify the key string. Return Value 2 min read Like