I have the following object consisting of three other objects of type array :

I want to get the text samsung out of that object and the rest of the objects. I have tried using a for in loop but I am getting the keys 0, 1 , 2.
for(brand in brands){
console.log(brand) // prints out `0, 1 , 2`
}
so I added another nested for in loop, but than I get 0, 0, 0 which are the keys within samsung, and other array objects within the rest of the objects.
What am i missing ?
brandsis an array of objects, each object having one property. I would suggest to convert the data to a single object with multiple properties, then your code would work. If you can't, then you are looking forObject.keys(brands[brand])[0].{'samsung': [...], 'otherbrand': [...], ...}.