If I have an object, like so:
const test = [
{ x: 'A', y:'1' },
{ x: 'A', y:'2' },
{ x: 'B', y:'1' },
{ x: 'A', y:'3' },
{ x: 'C', y:'1' },
];
How can I go through it, and find the in order sequence [A, B, C] from x, where [A, B, C] belongs to a unique y?
So far I tried iterating through the object using a for loop, finding all 'A', 'B', 'C', in order, but I cannot ensure that they all belong to the same y item.
=afterconst test