The question is not correct, you cannot define array like a map: [ x: 1, y:1 ], correct definition:
var a = {
32545343: {
data: [{id: 1}, {id: 2}]
},
547347: {
data: [{id: 1}, {id: 4}]
},
95757: {
data: [{id: 1}, {id: 6}]
}
};
one solution is using a flatmap (one implementation is here: https://gist.github.com/samgiles/762ee337dff48623e729)
Array.prototype.flatMap = function(lambda) {
return Array.prototype.concat.apply([], this.map(lambda));
};
then you can convert (do not forget a is not an array it is an object!)
var b = Object.keys(a).flatMap(function(key) { return a[key].data; });
// than you can distinct the list:
var result = b.filter(function(element, index, arr) { return arr.slice(index+1).filter(function(e) { return e.id === element.id }).length===0; });
console.log(result);
[and]should be a{and}.