Trying to loop through all graphics in view and delete ones that have geometry = "polyline"
const graphicsArr = view.graphics;
console.log(graphicsArr.length)
console.log(graphicsArr)
if (graphicsArr.length > 0) {
for (const graphic of graphicsArr.items) {
console.log(graphic)
if (graphic.geometry.type == "polyline") {
view.graphics.remove(graphic)
}
}
}
When I console.log my array of graphics, the length is twelve, but the loop only runs 6 times. Very frustrating. Anybody know what is going on?