The reducearray prototype method is used here :
var arr = JSON.parse(objstring)["density"];
var max = arr.reduce(function(a, b) {
return Math.max(a, b.quantity);
}, 0);
Another solution would be something like
var max = Math.max.apply(null, arr.map(function(item){
return item["quantity"];
}));
For more elegant ways, there are functional libraries that provide getter factory functions and other Array methods. A solution with such a library might look like
var max = arr.get("quantity").max();
which will do the same as above, but better expressed.