I have a piece of code that creates vertices in a loop.
for(var i=0; i<100; i++){
graph.add_vertex();
}
and another piece of code that seeks to clear them
graph.clear();
A vertex
calls the getId()
function, which simply assigns a incremented number. add_vertex
is the only function calling getId()
.
clear()
looks something like this:
for(var i=0; i<graph.V.length; i++){
console.log(graph.V[i]);
graph.V[i].remove();
}
and the output lists every other vertex. What could cause an error like this?