Given the following json object:
var posts = {
[0] : {
"name": "X",
"categories" : [1, 5, 6]
},
[1] : {
"name": "Y",
"categories" : [1, 5, 7]
}
}
How can I get a single array containing every "categories" property value, without repetitions?
In this case, I would like to retrieve something like
var objCategories = [1, 5, 6, 7];