VOOZH about

URL: https://www.geeksforgeeks.org/javascript/d3-js-d3-max-function/

⇱ D3.js d3.max() function - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

D3.js d3.max() function

Last Updated : 10 Oct, 2024

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 calculated. Here elements might be integers or any strings.

Return Value:

It returns the maximum value.

Example 1: This example shows the use of max() function.

Output:

60
2
6.8
0.8

Example 2: This example shows the use of max() function.

Output:

undefined
c
C
GeeksforGeeks
Comment
Article Tags: