add data.children[node] delete code in if condition: // draw EUtranCells of cosite…
- User
add data.children[node] delete code in if condition: // draw EUtranCells of cosite Nodeds Object.keys(data.children).forEach(node => { const { EUtranCellData, ENodeB } = data.children[node]; if (EUtranCellData.hasOwnProperty("error")) { // console.log(Date.now(), data.children[node]); // debugger;
codeconst sec = document.createElement('section') sec.appendChild(draw.eutranCellsCosite([EUtranCellData, ENodeB])) form.appendChild(sec) } }) - Assistant
Object.keys(data.children).forEach(node => { const { EUtranCellData, ENodeB } = data.children[node]; if (!EUtranCellData.hasOwnProperty("error")) { const sec = document.createElement('section') sec.appendChild(draw.eutranCellsCosite([EUtranCellData, ENodeB])) form.appendChild(sec) } })
- User
explain code
- Assistant
The code iterates over each node in the
data.childrenobject usingObject.keys(data.children).forEach(node => {...}).For each node, it extracts the
EUtranCellDataandENodeBproperties from thedata.children[node]object using destructuring assignment:const { EUtranCellData, ENodeB } = data.children[node];.Then, it checks if the
EUtranCellDatahas the property "error" using thehasOwnProperty()method:if (EUtranCellData.hasOwnProperty("error")) {...}.If the
EUtranCellDatahas the "error" property, it creates a new<section>element, appends the result of callingdraw.eutranCellsCosite()withEUtranCellDataandENodeBas arguments to the<section>element, and finally appends the<section>element to theformelement:codeconst sec = document.createElement('section') sec.appendChild(draw.eutranCellsCosite([EUtranCellData, ENodeB])) form.appendChild(sec)