Smart JS folks - this is why I can't pass the Google hiring test:
Given 2 to 3 arrays (it will either be 2 or 3, it can change), how would you return an array that only contains items in ALL the arrays.
Every solution I have found only seems to work w/ an array of simple values. I have an array of objects with a primary key, id.
@raymondcamden Is that situation unchangeable? For example, could you use a Map instead to begin with?
Actually, I just assumed you wanted one of each object. Is that the case? If not, doesn’t the concat() method do what you need?
Again, lots I don’t know: is order important, etc.?
Will be easier to help if you show us some code :)
@aral imagine 2-3 arrays of objects. i need an array of items that appear in all of them. each object can be identified by a "id" property. if i used a Set i could get unique items from all 3, but thats not what i need, it has to be things that exist in all 3, or 2 (if it was just 2, it would be pretty simple)