How about augmenting the built-in Array object to use Math.max/Math.min instead:

Array.prototype.max = function() {
  return Math.max.apply(null, this);
};

Array.prototype.min = function() {
  return Math.min.apply(null, this);
};

let p = [35,2,65,7,8,9,12,121,33,99];

console.log(`Max value is: ${p.max()}` +
  `\nMin value is: ${p.min()}`);

Here is a JSFiddle.

Augmenting the built-ins can cause collisions with other libraries (some see), so you may be more comfortable with just apply'ing Math.xxx() to your array directly:

var min = Math.min.apply(null, arr),
    max = Math.max.apply(null, arr);

Alternately, assuming your browser supports ECMAScript 6, you can use spread syntax which functions similarly to the apply method:

var min = Math.min( ...arr ),
    max = Math.max( ...arr );
Answer from Roatin Marth on Stack Overflow
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Math › min
Math.min() - JavaScript - MDN Web Docs
The Math.min() static method returns the smallest of the numbers given as input parameters, or Infinity if there are no parameters. console.log(Math.min(2, 3, 1)); // Expected output: 1 console.log(Math.min(-2, -3, -1)); // Expected output: -3 const array = [2, 3, 1]; console.log(Math.min(...
🌐
W3Schools
w3schools.com › jsref › jsref_min.asp
JavaScript Math min() Method
The Math.min() method returns the number with the lowest value.
🌐
Programiz
programiz.com › javascript › library › math › min
JavaScript Math min()
Here, ... is the spread operator that destructures the array and passes the array values as arguments to min(). The method then finds the smallest number. // min() with string argument let numbers1 = Math.min("Dwayne", 2, 5, 79); console.log(numbers1); // min() with characters arguments let minNum = Math.min('A', 'B', 'C'); console.log(minNum); // Output: // NaN // NaN · In the above example, we have used the min() method with the string and character arguments.
🌐
Math.js
mathjs.org › docs › reference › functions › min.html
math.js | an extensive math library for JavaScript and Node.js
math.min(2, 1, 4, 3) // returns 1 math.min([2, 1, 4, 3]) // returns 1 // minimum over a specified dimension (zero-based) math.min([[2, 5], [4, 3], [1, 7]], 0) // returns [1, 3] math.min([[2, 5], [4, 3], [1, 7]], 1) // returns [2, 3, 1] math.max(2.7, 7.1, -4.5, 2.0, 4.1) // returns 7.1 math.min(2.7, 7.1, -4.5, 2.0, 4.1) // returns -4.5
🌐
CoreUI
coreui.io › answers › how-to-find-the-minimum-value-in-an-array-in-javascript
How to find the minimum value in an array in JavaScript · CoreUI
September 21, 2025 - Use Math.min with spread operator to efficiently find the smallest number in a JavaScript array with modern syntax.
🌐
Vultr Docs
docs.vultr.com › javascript › standard-library › Math › min
JavaScript Math min() - Find Minimum Value | Vultr Docs
November 27, 2024 - The variables a, b, and c are evaluated by Math.min(), which returns the smallest value, -1. Expand array elements as individual arguments using the spread syntax.
Find elsewhere
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › find-the-min-max-element-of-an-array-using-javascript
Min and Max of an Array in JavaScript - GeeksforGeeks
To find the minimum or maximum element in a JavaScript array, use Math.min or Math.max with the spread operator.
Published   August 2, 2025
🌐
Medium
medium.com › @vladbezden › how-to-get-min-or-max-of-an-array-in-javascript-1c264ec6e1aa
How to get min or max of an array in JavaScript | by Vlad Bezden | Medium
September 2, 2016 - const nums = [1, 2, 3] Math.min(...nums) // 1 Math.max(...nums) // 3 · … in front of an array will convert array to distinct variables and send them to the function, which is equivalent to
🌐
W3docs
w3docs.com › javascript
How to Find the Min/Max Elements in an Array in JavaScript
For regular arrays you can use ... uses the apply() method to find the maximum element in a numeric array: Math.min.apply(Math, testArr); Math.max.apply(Math, testArr);...
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › javascript-min-element-in-an-array
JavaScript – Min Element in an Array - GeeksforGeeks
July 23, 2025 - Note: You must add a conditional ... them. This method uses the Math.min() function to find the smallest value in the array by spreading the elements as individual arguments....
🌐
LaunchCode
education.launchcode.org › intro-to-professional-web-dev › appendices › math-method-examples › max-and-min-examples.html
Math.max and Math.min Examples — Introduction to Professional Web Development in JavaScript documentation
This approach uses the syntax from the sorting studio to first order the array. The maximum (or minimum) value can then be identified with bracket notation. ... An alternative to the sorting approach described above is to use the spread operator (...), also called spread syntax. In cases where a set of numbers or strings (x, y, z, etc.) is expected, an array cannot be used as-is.
🌐
Reddit
reddit.com › r/javascript › why don't math.max and math.min accept arrays? why are they n-arity functions?
r/javascript on Reddit: Why don't Math.max and Math.min accept arrays? Why are they n-arity functions?
February 13, 2017 -

Edit: I am not asking for a way to use these methods with arrays. What I am asking is why in the first place do they not accept arrays.

However, I will list the solutions mentioned:

  1. Math.max.apply(null, arr)

  2. Math.max(...arr)

  3. arr.reduce((max, current) => (current > max ? current : max), -Infinity);

🌐
Reintech
reintech.io › blog › tutorial-applying-math-min-method
Applying the Math.min() Method | Reintech media
January 13, 2026 - The method takes any number of arguments and returns the smallest. It can also be used to find the smallest number in an array by using the spread operator (...) to spread the elements of the array as arguments to the function.
🌐
Stack Abuse
stackabuse.com › javascript-get-min-and-max-element-of-array
JavaScript: Get Min and Max Element of Array
April 6, 2023 - This makes it possible for us to enter arrays into the Math.min() static function: const myArray = [20, 23, 27]; let minElement = Math.min.apply(Math, myArray); console.log(minElement); // 20 // Or let minElement = Math.min.apply(null, myArray); console.log(minElement); // 20 · Loops are used in JavaScript to perform repeated tasks based on a condition.
🌐
30 Seconds of Code
30secondsofcode.org › home › javascript › array › min and max value of an array
Min and max value of a JavaScript array - 30 seconds of code
December 30, 2023 - const nums = [2, 4, 6, 8, 1, 3, 5, 7]; Math.max(...nums); // 8 Math.min(...nums); // 1 · What if you need to find the n minimum or maximum values? Turns out it's almost as easy. For either one of the operations, we'll first need to sort the array in ascending or descending order.
🌐
TutorialsPoint
tutorialspoint.com › javascript › math_min.htm
JavaScript Math.min() Method
<html> <body> <script> let Array = [10, 20, 30, 40, 50, 60, 90]; let MinNum = Math.min(...Array); document.write("Lowest number: ", MinNum); </script> </body> </html> The spread operator will destructure the array and then this method finds the lowest number. Here, we are passing string and character arguments to this method − · <html> <body> <script> let number1 = Math.min("John", 30, 50, 90); document.write(number1, "<br>"); let number2 = Math.min("John", "Smith", "Candice", "Alisa"); document.write(number2); </script> </body> </html>
🌐
TechOnTheNet
techonthenet.com › js › math_min.php
JavaScript: Math min() function
In this example, the min() method returned 2 which is the smallest value from the array called totn_array.
🌐
YouTube
youtube.com › watch
How to Find Maximum and Minimum in an Array in JavaScript |Use Math.max() and Math.min() in JS - YouTube
Want to find the highest or lowest value in a JavaScript array? In this beginner-friendly tutorial, you'll learn how to find the maximum and minimum values i...
Published   July 6, 2025