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. 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.
🌐
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 ... among them. This method uses the Math.min() function to find the smallest value in the array by spreading the elements as individual arguments....
🌐
W3Schools
w3schools.com › jsref › jsref_min.asp
JavaScript Math min() Method
The Math.min() method returns the number with the lowest value. The Math.max() Method · Math.min(n1, n2,...) Full JavaScript Math Tutorial · Full JavaScript Math Reference · Full JavaScript Numbers Tutorial · Full JavaScript Number Reference ...
🌐
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.
🌐
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 - If n is greater than or equal to the length of the array, we'll get the original array back. const minN = (arr, n = 1) => [...arr].sort((a, b) => a - b).slice(0, n); const maxN = (arr, n = 1) => [...arr].sort((a, b) => b - a).slice(0, n); minN([1, 2, 3]); // [1] minN([1, 2, 3], 2); // [1, 2] maxN([1, 2, 3]); // [3] maxN([1, 2, 3], 2); // [3, 2] For more complex cases, such as finding the min/max value in an array of objects, you will have to use Array.prototype.map().
🌐
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
🌐
JavaScript in Plain English
javascript.plainenglish.io › how-to-get-min-or-max-of-an-array-in-javascript-and-typescript-ed1087c080cf
How To Get Min Or Max Of An Array In JavaScript And TypeScript | by Sam C. Tomasi | JavaScript in Plain English
April 23, 2024 - export class Kata { static highAndLow(numbers: string): string { const arr: number[] = numbers.split(" ").map((c) => parseInt(c)); const max: number = Math.max(...arr); const min: number = Math.min(...arr)
🌐
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 - To get the minimum or maximum value of a specific property in a JavaScript array of objects, you can use the `reduce()` function along with some additional logic.
🌐
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 › 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
🌐
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?
After performing these steps, we will use for loop to traverse the array elements and update the values of min and max with each iteration to the current minimum and the maximum element in the array. In this approach of finding the maximum and the minimum element in the array, we will use the in-built Math.max() and Math.min() methods of JavaScript with the apply() method or array destructuring syntax.
🌐
W3Resource
w3resource.com › javascript-exercises › javascript-math-exercise-7.php
JavaScript Math: Find the lowest value in an array - w3resource
Write a JavaScript function to find the lowest value in an array. Test Data : console.log(min([12,34,56,1])); console.log(min([-12,-34,0,-56,-1])); 1 -56
🌐
Latenode
community.latenode.com › other questions › javascript
Finding the Index of the Minimum Value in a JavaScript Array - JavaScript - Latenode Official Community
January 22, 2025 - I’m new to JavaScript and need some help! I created an array containing several numerical values and wrote a function to determine the smallest value. However, I’m curious if it’s possible to also retrieve the index of t…
🌐
Stack Abuse
stackabuse.com › javascript-get-min-and-max-element-of-array
JavaScript: Get Min and Max Element of Array
April 6, 2023 - The apply() method is used to invoke a function with a given this value and an array of arguments. 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.
🌐
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.
🌐
DEV Community
dev.to › dailydevtips1 › javascript-find-minmax-from-array-of-arrays-1bkg
JavaScript find min/max from array of arrays - DEV Community
July 16, 2022 - As a reminder, the reduce function loop over each array item takes two arguments. ... We then check if the current item property 1 (meaning the age) is bigger than the current one. If that is the case, we return the current item as it's higher. Else, we return whatever was in the previous 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.