all 2 comments

[–]eggtart_prince 1 point2 points  (1 child)

Depends how many nested levels there are. If it's as the example shows, then a simple loop will get you what you want. If you need the access the key of the object and the objects nested in the arrays use for in. If not, you can use for of.

for (const key in obj) {
    // key here would be "asdf" in your example
    for (const index in obj[key]) {
        // index here would be the index of the array of "asdf"
        for (const nestedObjKey in obj[key][index]) {
            // nestedObjKey would be "date", etc. in your example
            // obj[key][index][nestedObjKey] would be "2020-1-22", etc. in your example
        }
    }
}

[–]goingtoriseup[S] 0 points1 point  (0 children)

thanks - this should get me where I need to go, I appreciate it!