You'll have to extract the properties from the objects yourself:

var maximum = Math.max.apply(Math, myArr.map(function(o) { return o.x; }));

That uses .map() to iterate through the elements of the array and return the value of the "x" property. That result array is then passed as the arguments to Math.max().

Now that => functions are widely available it'd be a little shorter as so:

var maximum = Math.max.apply(Math, myArr.map(o => o.x));

Still doing pretty much the exact same thing of course.

Answer from Pointy on Stack Overflow
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › Math › max
Math.max() - JavaScript | MDN
Math.max(10, 20); // 20 Math.max(-10, -20); // -10 Math.max(-10, 20); // 20 · Array.prototype.reduce() can be used to find the maximum element in a numeric array, by comparing each value: js · const arr = [1, 2, 3]; const max = arr.reduce((a, b) => Math.max(a, b), -Infinity); The following function uses Function.prototype.apply() to get the maximum of an array.
🌐
W3Schools
w3schools.com › jsref › jsref_max.asp
JavaScript Math max() Method
The Math.max() method returns the number with the highest value.
🌐
Programiz
programiz.com › java-programming › library › math › max
Java Math max()
In the above example, we have used the Math.max() method with int, long, float, and double type arguments. class Main { public static void main(String[] args) { // create an array of int type int[] arr = {4, 2, 5, 3, 6}; // assign first element of array as maximum value int max = arr[0]; for (int i = 1; i < arr.length; i++) {
🌐
Built In
builtin.com › articles › javascript-array-max
3 Methods to Find the JavaScript Array Max | Built In
In this traditional approach, we loop through each element in the array and compare it with a previously stored maximum value. If the current element is greater, we update our maximum. let numbers = [3, 7, 2, 8, 5]; let max = numbers[0]; // initialize to the first value for (let i = 1; i < numbers.length; i++) { if (numbers[i] > max) { max = numbers[i]; } } console.log(max); // Outputs: 8 · JavaScript’s Math.max() can find the maximum among individual numbers...
🌐
Math.js
mathjs.org › docs › reference › functions › max.html
math.js
math.max(2, 1, 4, 3) // returns 4 math.max([2, 1, 4, 3]) // returns 4 // maximum over a specified dimension (zero-based) math.max([[2, 5], [4, 3], [1, 7]], 0) // returns [4, 7] math.max([[2, 5], [4, 3], [1, 7]], 1) // returns [5, 4, 7] 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
Find elsewhere
🌐
Vultr Docs
docs.vultr.com › javascript › standard-library › Math › max
JavaScript Math max() - Find Maximum Value | Vultr Docs
November 27, 2024 - By accepting multiple numbers or an array of numbers (with a spread operator), this method evaluates and returns the largest number in the set, facilitating numerical comparisons directly in your code.
🌐
CoreUI
coreui.io › answers › how-to-find-the-maximum-value-in-an-array-in-javascript
How to find the maximum value in an array in JavaScript · CoreUI
September 21, 2025 - Use Math.max with spread operator to efficiently find the largest number in a JavaScript array with modern syntax.
🌐
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
🌐
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
🌐
SheCodes
shecodes.io › athena › 1878-using-math-max-to-find-maximum-value-in-javascript
[JavaScript] - Using `Math.max()` to Find Maximum Value in | SheCodes
Learn how to use the JavaScript Math.max() method to find the largest of zero or more numbers. Understand how to use `Math.max.apply()` with an array.
🌐
MathWorks
mathworks.com › matlab › data import and analysis › descriptive statistics
max - Maximum elements of array - MATLAB
If A is a matrix, then max(A) is a row vector containing the maximum value of each column of A. If A is a multidimensional array, then max(A) operates along the first dimension of A whose size does not equal 1, treating the elements as vectors. The size of M in this dimension becomes 1, while ...
🌐
Programiz
programiz.com › javascript › library › math › max
JavaScript Math max()
Here, ... is the spread operator that destructures the array and passes the array values as arguments to max(). The method then finds the smallest number. // max() with the string argument let numbers1 = Math.max("Dwayne", 2, 5, 79); console.log(numbers1);
🌐
Jsremote
jsremote.jobs › tutorials › math-max
What is the Math.max() method in JavaScript? | Web developer jobs
For the most part, using the Math.max() function in JavaScript is easy and straightforward. Its primary use is to get the largest number of zero or more numbers. Don’t forget that you can utilize this function when working with arrays, making it a huge advantage for working with vast bulks of data.
🌐
Dmitri Pavlutin
dmitripavlutin.com › javascript-math-max-infinity
Why Math.max() Without Arguments Returns -Infinity
Math.max(num1, num2, ..., numN) accepts multiple number arguments and returns the maximum number of them. Simple as a pie. If you want to determine the maximum number of an array, then you can use the spread arguments operator on the array:
🌐
MDN
mdn2.netlify.app › en-us › docs › web › javascript › reference › global_objects › math › max
Math.max() - JavaScript | MDN
Math.max(10, 20); // 20 Math.max(-10, -20); // -10 Math.max(-10, 20); // 20 · Array.reduce() can be used to find the maximum element in a numeric array, by comparing each value: var arr = [1,2,3]; var max = arr.reduce(function(a, b) { return ...
🌐
YouTube
youtube.com › code 2020
JavaScript tips — Find the maximum value in an array of numbers - YouTube
You can find the largest number in an array in #JavaScript with a single function call and without writing any loopsJust call Math.max(...yourArray) to get t...
Published   October 5, 2022
Views   4K