I have two array: pts
and I want to create new test
array.
Every time I add new object from pts
to test
I need to call function that will execute mimicSvg(test,1) function, with array test (from 0 to m)
I write:
var test=[{"X":"300","Y":"400"}];
for(var m=1;m<pts.length;m++){
var q = pts[m].X;
var e = pts[m].Y;
test.push({"X":q,"Y":e});
setInterval(mimicSvg(test,1), 2000);
}
but setInterval dont work, instead that I get execution on all m
times function at the same time.
How I can solve that problem?