The problem of taking the value of es6 object

ES6 value problem

clipboard.png

wants to take the value of dateline, but the number 104is the id value of the request, and there may be multiple.
0 is an array, or there may be more than one, which needs to be traversed and displayed, similar to the timeline

.
Es6
Dec.24,2021

temporarily use id on url for processing, and id is put in this.props, but this is only a temporary solution to the problem. There is still a large amount of data to be processed


.

my understanding is that you want to start from something like

{
    104: [
        {dateline: "xxx"},
        {dateline: "yyy"}
    ],
    105: [
        {dateline: "aaa"},
        {dateline: "bbb"}
    ]
}
["xxx", "yyy", "aaa", "bbb"] ?

if so, you can first try using flatMap . Maybe IE and Edge do not support

.
Object.values(obj)
    .map(x => x.map(y => y.dateline))
    .reduce((prev, cur) => prev.concat(cur), [])
Menu