Assuming I have the following:
var array = [ {\"name\":\"Joe\", \"age\":17}, {\"name\":\"Bob\", \"age\":17}, {\"name\":\"Carl\
If you have Array.prototype.includes or are willing to polyfill it, this works:
var ages = []; array.forEach(function(x) { if (!ages.includes(x.age)) ages.push(x.age); });