const data = [
{0: {id: "1",cat:{string:[{color:"yellow",weight:"10"},{color:"orange",Weight:"10"}]}},
{1: {id: "1",cat:{string:[{color:"blue",weight:"10"},{color:"orange",Weight:"10"}]}},
{2: {id: "1",cat:{string:[{color:"white",weight:"10"},{color:"orange",Weight:"10"}]}},
{3: {id: "1",cat:{string:[{color:"blue",weight:"10"},{color:"orange",Weight:"10"}]}},
]
Filter by Color: "Yellow"
Desired Output: [{0: {id: 1, country: "SA", address: "IOXX",cat:[{color: "yellow",weight: "10"}]}}]
catArray has multiple objects? If yes, what would you expect? Should all of the objects have the color of Yellow to return that record? Or if just one of them pass the condition you'll accept that?