Say your array looks like this:
var persons = [{Name:"John",Age:12},{Name:"Joe",Age:5}];
then you can:
var min = Math.min.apply(null, persons.map(function(a){return a.Age;})) ,max = Math.max.apply(null, persons.map(function(a){return a.Age;}))
[ Change ] Added ES2015 method:
const minmax = (someArrayOfObjects, someKey) => { const values = someArrayOfObjects.map( value => value[someKey] ); return { min: Math.min.apply(null, values), max: Math.max.apply(null, values) }; }; console.log( minmax( [ {Name: "John", Age: 12}, {Name: "Joe", Age: 5}, {Name: "Mary", Age: 3}, {Name: "James sr", Age: 93}, {Name: "Anne", Age: 33} ], 'Age') );
source share