After examining the "Array" image, how can I access all levels within this array?
I attempted to use a foreach loop, but it only allows me to reach the first object and not the second object containing strings.
for (var key in result)
{
if (result.hasOwnProperty(key))
{
console.log(key, result[key]);
for(var item in result[key])
{
console.log(item);
}
}
}
I also experimented with:
result[key[item]]
However, this returned undefined results.
I understand that accessing elements by their name is straightforward, but since names constantly change, the solution needs to be adaptable.
I have included a Demo in the comments section to observe its behavior.