In my current scenario, I am working with a substantial array containing 120 objects. Each object within the array possesses an id value and an opposite_id value, essentially forming pairs. I'm looking for the most efficient approach to iterate through each object and either store the pairs in a new array or present them together as a pair.
For instance:
Obj1 = {
id: 1,
opposite_id: 2,
descr: "This is the first object"
},
Obj2 = {
id: 2,
opposite_id: 1,
descr: "This is the second object"
},
Obj3 = {
id: 3,
opposite_id: 6,
descr: "This is the third object"
}
I aim to showcase Obj1 and Obj2 concurrently (ideally utilizing ng-repeat) as a pair without displaying both Obj2 and Obj1 to avoid repetition. Figuring out how to achieve this specific task is proving challenging for me, any guidance on this matter would be highly appreciated! Thank you