So I have a map on which I draw trade routes(as arcs) between countries with arc.js. The arcs are different based on the year, and I basically want to be able to redraw the arcs based on what year I pick.
I create the arcs like so:
 //for every trade route, draw a arc from start to end 
var line_to_add;
for(var q = 0; q < dest_Coor.length; q++) {
    //create the arc
    var start = {x: from_Coor[0][0], y: from_Coor[0][1]};
    var end = {x: dest_Coor[q][0], y: dest_Coor[q][1]};
    var generator = new arc.GreatCircle(start,end);
    var line = generator.Arc(100, {offset: 10});
    //add it to map 
    line_to_add = L.geoJson(line.json(), {
        color: "#004c00"
    });
    //add the arc to global array of arcs
    allArrows.push(line_to_add);
    line_to_add.addTo(map);
}
When a different year is picked, I then try to delete the current arcs through this method, with allArrows being a global array of all arc objects(according to this question): 
function deleteOldArcs() {
    for(var i = 0; i < allArrows.length; i++) {
        map.removeLayer(allArrows[u]);
    }
    //then reset the list of arrows:
    allArrows.length = 0;
}
However, this doesn't work and program execution just freezes inside map.removeLayer(allArrows[u]), and I don't understand why. I checked the list of map layers with map._layers, and the arc objects are in there... so why would calling map.removelayer not work? 
Any help would be greatly appreciated, thanks!!
 
     
    