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
The Math.min() static method returns the smallest of the numbers given as input parameters, or Infinity if there are no parameters.
🌐
W3Schools
w3schools.com › jsreF › jsref_min.asp
JavaScript Math min() Method
The Math.min() method returns the number with the lowest value.
Discussions

Javascript Math.min/max function explanation
That's spread syntax . Math.max() (and Math.min()) expects one or more arguments, but not an array of arguments. Spreading the array passes every element in the array as a separate argument to Math.max() like it expects. More on reddit.com
🌐 r/learnprogramming
2
2
February 10, 2020
Find the min/max element of an array in JavaScript - Stack Overflow
2 I have a low temperature array in javascript and I need to get the lowest temp so I used the min.math function More on stackoverflow.com
🌐 stackoverflow.com
Why don't Math.max and Math.min accept arrays? Why are they n-arity functions?
or ES6+ version Math.min(...myNums) More on reddit.com
🌐 r/javascript
33
40
February 13, 2017
Math.min and Math.max methods with JS
I first wrote this code: let numbers = (10, 15, 59, 20); let a = Math.max(numbers); console.log(a); …which display 20 in the console. I’ve noticed that it always returns the last number of the numbers variable. Then, i wrote this (I’ve found it on W3S and modify it a bit): function ... More on forum.freecodecamp.org
🌐 forum.freecodecamp.org
0
May 23, 2019
🌐
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 ·
🌐
Scaler
scaler.com › home › topics › math min() javascript function
Math min() JavaScript Function - Scaler Topics
May 4, 2023 - There will be multiple instances when we have to find out the minimum of two or more numbers (any type). In Javascript programming, we can use the inbuilt Math.min() function to return the smallest number in a set of numbers (there can be
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › javascript-math-min-method
JavaScript Math min() Method - GeeksforGeeks
July 15, 2024 - The JavaScript Math min( ) Method is used to return the lowest-valued number passed in the method. The Math.min() method returns NaN if any parameter isn't a number and can't be converted into one.
Find elsewhere
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Math
Math - JavaScript | MDN
In JavaScript, we can do this with the following: js · 50 * Math.tan(degToRad(60)); We use our degToRad() function to convert 60 degrees to radians, as Math.tan() expects an input value in radians. This can be achieved with a combination of Math.random() and Math.floor(): js · function random(min, max) { const num = Math.floor(Math.random() * (max - min + 1)) + min; return num; } random(1, 10); Number ·
🌐
DEV Community
dev.to › igadii › why-mathmin-mathmax-in-javascript-makes-complete-sense-as-it-is-164p
Why is Math.min() Greater-Than Math.max() in JavaScript - DEV Community
March 11, 2025 - Math.min() and Math.max() are static methods of the Math class that takes in a set of numbers as input arguments and returns the smallest or the largest number from the set respectively.
🌐
Vultr Docs
docs.vultr.com › javascript › standard-library › Math › min
JavaScript Math min() - Find Minimum Value | Vultr Docs
November 27, 2024 - The Math.min() function in JavaScript is a method used to determine the smallest value among the given arguments.
🌐
TutorialsPoint
tutorialspoint.com › home › javascript › javascript math.min() function
Understanding JavaScript Math.min() Function
September 1, 2008 - In JavaScript, the Math.min() method accepts any number of arguments, and it returns the minimum value among those arguments.If any of the arguments is not a number, "NaN" (Not-a-Number) is returned.
🌐
University of Houston-Clear Lake
sceweb.uhcl.edu › helm › WEBPAGE-Javascript › my_files › Object › Module-7 › Mrthod › javascript__math_min_method.html
JavaScript - Math min Method
Math.min(value1, value2, ... valueN ) ; ... Returns the smallest of zero or more numbers. Try the following example program. <html> <head> <title>JavaScript Math min() Method</title> </head> <body> <script type="text/javascript"> var value = Math.min(10, 20, -1, 100); document.write("First ...
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Number › MIN_VALUE
Number.MIN_VALUE - JavaScript | MDN
July 10, 2025 - The Number.MIN_VALUE static data property represents the smallest positive numeric value representable in JavaScript.
🌐
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
Math.max and Math.min Examples · The general syntax for this method is: Math.max(x, y, z, ...) This method finds and returns the largest value from a set of numbers (x, y, z, ...). To find the maximum value in an array, see below. Example · console.log(Math.max(2, 3, 100.01, 0, -5.2, 100)); ...
🌐
Mozilla
interactive-examples.mdn.mozilla.net › pages › js › math-min.html
JavaScript Demo: Math.min()
console.log(Math.min(2, 3, 1)); // Expected output: 1 console.log(Math.min(-2, -3, -1)); // Expected output: -3 const array1 = [2, 3, 1]; console.log(Math.min(...array1)); // Expected output: 1 · Run › · Reset
🌐
Programiz
programiz.com › javascript › library › math › min
JavaScript Math min()
Become a certified JavaScript programmer. Try Programiz PRO! ... The min() method finds the minimum value among the specified values and returns it. let numbers = Math.min(12, 4, 5, 9, 0, -3); console.log(numbers); // Output: -3
🌐
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);

🌐
freeCodeCamp
forum.freecodecamp.org › javascript
Math.min and Math.max methods with JS - JavaScript
May 23, 2019 - I first wrote this code: let numbers = (10, 15, 59, 20); let a = Math.max(numbers); console.log(a); …which display 20 in the console. I’ve noticed that it always returns the last number of the numbers variable. Then, i wrote this (I’ve found it on W3S and modify it a bit): function myFunction() { var a = Math.min(5, 10); var b = Math.min(0, 150, 30, 20, 38); var c = Math.min(-5, 10); var d = Math.min(-5, -10); var e = Math.min(1.5, 2.5); console.log(a + " " + b + " " + ...
🌐
Reality Ripple
udn.realityripple.com › docs › Web › JavaScript › Reference › Global_Objects › Math › min
Math.min() - JavaScript
The static function Math.min() returns the lowest-valued number passed into it, or NaN if any parameter isn't a number and can't be converted into one.