I have an array of nested object, I am trying to remove undefined
value deep down the array
let partialMatch = [
{
lines: [{ id: 1}, {id: 2}]
},
{
lines: [{ id: 10}, {id: 25}, undefined ]
}
]
So far I have
partialMatch.forEach((x) => {
x.lines.forEach((y, index) => {
if (!y) {
x.lines.splice(0, index);
}
});
});