Nested forEach loop does not work

后端 未结 3 1944
臣服心动
臣服心动 2021-02-08 02:22

I have some data that is in JSON object array. I\'m trying to use nested forEach loops to extract the data.

The data is modeled like belo. There\'s multiple dataModels

3条回答
  •  故里飘歌
    2021-02-08 03:06

    It appears to me that your solution is correct, but you're missing a parentheses and you're not referencing the childNodes attribute:

    data.forEach(function(entry){
        entry.childNodes.forEach(function(childrenEntry){
          console.log(childrenEntry.appId);
        })
    })
    

提交回复
热议问题