Solved! Go to Solution.
map.graphics.graphics.forEach(function(g){ if(g.attributes){ if(g.attributes.foo == "foo" || g.attributes.bar == "bar"){ map.graphics.remove(g); } } });
map.graphics.graphics.forEach(function(g){ if(g.attributes){ if(g.attributes.foo == "foo" || g.attributes.bar == "bar"){ map.graphics.remove(g); } } });