D3.js least() Method Last Updated : 23 Sep, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report With the help of d3.least() method, we can get the least value from the sequence of numbers in an array by using this method. Syntax: d3.least(iterable) Parameter: This function has the following parameter as mentioned above and described below: iterable: Insert any kind of iterable object. Return Value: It return the least value. Note: To execute the below examples, you have to install the d3 library by using this command prompt we have to execute the following command. npm install d3 Example 1: In this example, we can see that by using d3.least() method, we are able to get the least value from the sequence from an array by using this method. Filename: index.js javascript // Defining d3 variable var d3 = require('d3'); var gfg = d3.least([5, 4, 3, 2, 1]) console.log(gfg) Output: 1 Example 2: Filename: index.js javascript // Defining d3 contrib variable var d3 = require('d3'); var arr = [] for(var i = 0; i < 5; i++) { arr.push(Math.random()); } var gfg = d3.least(arr); console.log(gfg); Output: 0.09124116961036877 Note: The above program will compile and run by using the following command: node index.js Reference: https://github.com/d3/d3-array/blob/master/README.md Comment More infoAdvertise with us Next Article D3.js least() Method J jitender_1998 Follow Improve Article Tags : JavaScript Web Technologies D3.js D3.js Array Similar Reads D3.js leastIndex() Method With the help of d3.leastIndex() method, we can get the index of least value from the sequence of numbers in an array by using this method. Syntax: d3.leastIndex( iterable ) Parameter: This function has the following parameter as mentioned above and described below: iterable: Insert any kind of iter 1 min read Collect.js last() Method The last() method is used to return the last element from the collection that satisfy the given truth test. Syntax: collect(array).last(callback) Parameters: The collect() method takes one argument that is converted into the collection and then last() method is applied on it. The last() method holds 1 min read D3.js bisector.left() Method With the help of bisector.left() method, we can insert the element in the sorted array in such a way that if the value in the array is equal to or greater than the element to be inserted than will insert in the left of the present element by using this method. Syntax: bisector.left(arr, ele) Paramet 2 min read D3.js greatest() Method With the help of d3.greatest() method, we can get the largest value from the sequence of numbers in an array by using this method. Syntax: d3.greatest(iterable) Parameter: This function has the following parameter as mentioned above and described below: iterable: Insert any kind of iterable object. 1 min read D3.js maxIndex() Method With the help of d3.maxIndex() method, we can get the index of value which is found to be maximum in an array of numbers, strings or dates. We can use any kind of array we just got the index of maximum value by using this method. Syntax: d3.maxIndex( iterable ) Parameter: This function has the follo 2 min read Like