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 - Mozilla
July 20, 2025 - 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(...
🌐
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 - This approach is concise, performant, and utilizes JavaScript’s built-in mathematical functions for reliable results. Use Math.min() with the spread operator to find the smallest value in an array. const numbers = [3, 7, 2, 9, 1, 5] const ...
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › javascript-min-element-in-an-array
JavaScript – Min Element in an Array - GeeksforGeeks
July 23, 2025 - ... const a = [5, 12, 8, 130, 44]; ... a[i]; } } console.log(res); ... The reduce() method processes each element of the array, comparing it with an accumulator (res) to track the smallest value....
🌐
Vultr Docs
docs.vultr.com › javascript › standard-library › Math › min
JavaScript Math min() - Find Minimum Value | Vultr Docs
November 27, 2024 - ... let mixedArray = [10, 'text', ... importance of ensuring that all elements are numeric before using this method. The Math.min() method in JavaScript offers a straightforward way to determine the smallest number from a set ...
🌐
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 - 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. This can be done using Array.prototype.sort() and the appropriate comparator function.
🌐
CodeBurst
codeburst.io › javascript-finding-minimum-and-maximum-values-in-an-array-of-objects-329c5c7e22a2
JavaScript: Finding Minimum and Maximum values in an Array of Objects | by Brandon Morelli | codeburst
August 21, 2017 - Now that we have a simple Array of numbers, we use Math.min() or Math.max() to return the min/max values from our new Y value array. The spread operator allows us to insert an array into the built in function.
🌐
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
Find elsewhere
🌐
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 - That is because Math.min or Math.max functions expect distinct variables and not an array. So in order to do that before ES6/ES2015 apply method was used · var nums = [1, 2, 3] Math.min.apply(Math, nums) // 1 Math.max.apply(Math, nums) // 3 Math.min.apply(null, nums) // 1 Math.max.apply(null, nums) // 3 · With ES6/ES2016 destructuring assignment it becomes easier · The destructuring assignment syntax is a JavaScript expression that makes it possible to extract data from arrays or objects into distinct variables.
🌐
W3Resource
w3resource.com › javascript-exercises › javascript-math-exercise-7.php
JavaScript Math: Find the lowest value in an array - w3resource
July 11, 2025 - // Define a function named min that takes an input array. function min(input) { // Check if the input is an array, if not, return false. if (toString.call(input) !== "[object Array]") return false; // Return the minimum value from the input ...
🌐
W3docs
w3docs.com › javascript
How to Find the Min/Max Elements in an Array in JavaScript
The Math.max function uses the apply() method to find the maximum element in a numeric array: Math.min.apply(Math, testArr); Math.max.apply(Math, testArr); Javascript Math.max.apply find max element in array
🌐
GeeksforGeeks
geeksforgeeks.org › find-the-min-max-element-of-an-array-using-javascript
Find the min/max element of an Array using JavaScript | GeeksforGeeks
To find the minimum or maximum element in a JavaScript array, use Math.min or Math.max with the spread operator.
Published   January 7, 2025
🌐
Delft Stack
delftstack.com › home › howto › javascript › javascript max of array
How to Find Max/Min Value in JavaScript Array | Delft Stack
February 2, 2024 - To find the minimum value present in a given array, we can use the Math.min() function in JavaScript. This function returns the minimum value present in a given array. For example, let’s define an array with some random values and find its ...
🌐
TutorialsPoint
tutorialspoint.com › how-to-find-the-minimum-value-of-an-array-in-javascript
How to find the minimum value of an array in JavaScript?
July 30, 2019 - <html> <body> <script> function minimum(value) { if (toString.call(value) !== "[object Array]") return false; return Math.min.apply(null, value); } document.write(minimum([6,39,55,1,44])); </script> </body> </html> ... Using sort() and compare functions we can write the elements in ascending ...
🌐
Medium
rathoreaparna678.medium.com › how-to-get-min-or-max-value-of-a-property-in-a-javascript-array-of-objects-b39c279205b9
How to Get Min or Max Value of a Property in a JavaScript Array of Objects? | by Aparna Rathore | Medium
July 17, 2023 - const maxScore = findMaxValue(data, ‘score’); console.log(maxScore); // Output: 95 ``` In both cases, the `reduce()` function is used to iterate over each object in the array. The initial value (`Infinity` for minimum, `-Infinity` for maximum) is set to ensure that the first comparison sets the initial minimum or maximum value correctly.
🌐
Medium
medium.com › coding-at-dawn › the-fastest-way-to-find-minimum-and-maximum-values-in-an-array-in-javascript-2511115f8621
The Fastest Way to Find Minimum and Maximum Values in an Array in JavaScript | by Dr. Derek Austin 🥳 | Coding at Dawn | Medium
January 4, 2023 - There are several built-in ways to find a minimum or maximum value from an array in JavaScript, including using the Math functions with the spread operator (…) and sorting the array numerically with .sort().
🌐
TutorialsPoint
tutorialspoint.com › article › function-that-returns-the-minimum-and-maximum-value-of-an-array-in-javascript
Function that returns the minimum and maximum value of an array in JavaScript
Finally, it returns an object with the minimum and maximum values. function findMinMax(array) { let min = array[0]; let max = array[0]; for (let i = 1; i < array.length; i++) { if (array[i] < min) { min = array[i]; } if (array[i] > max) { max ...
🌐
JavaScript in Plain English
javascript.plainenglish.io › how-to-get-min-or-max-value-of-a-property-in-a-javascript-array-of-objects-3fdf318f2019
How to Get Min or Max Value of a Property in a JavaScript Array of Objects? | by John Au-Yeung | JavaScript in Plain English
July 23, 2024 - Then we can use the Math.min or Math.max methods to get the min or max values from the array by spreading the value array as arguments into the methods. ... Available for free exclusively on the free and open blogging platform, Differ.
🌐
TutorialsPoint
tutorialspoint.com › How-to-find-the-min-max-element-of-an-Array-in-JavaScript
How to find the min/max element of an Array in JavaScript?
October 31, 2022 - <html> <body> <p>The original array: ... of the array is: " + min; </script> </body> </html> In this example, we declared an array of numbers as array, and then declare two variables as min and max with initial values as the first element of the array, both of these variables ...