Q:

How to find the maximum value in JSON array which also contains some JSON array

Please find the below array JSON Object. 
points:[{x:1, YValues:[34,45,56]}, {x:5, YValues:[20,12,30]}, {x:8, YValues:[12,13]}]

I want to find the maximum value of X and find the maximum value of YValues separately. 
I don't expect for loop to find the maximum value.  Expecting in simple way to find the maximum of X as well as maximum of YValues from points JSON object. 
Is it possible to use Math.max or any custom function ? 
Thanks,
Siva

A:

Something like this? 
Math.max.apply(0,points.map(function(v){return v.x}));

Still a loop, but it's succinct. 
Here's how to do it for YValues.  A long line though:
Math.max.apply(0,[].concat.apply([],arr.map(function(v){return v.YValues})));

