I've looked at similar questions but can't get setTimeout to work with a forEach loop, even using the index to increase the delay:
pointArray.forEach(function(p) {
setTimeout(addPt(p, 24, red), pointArray.indexOf(p) * 100000);
});
See that I've increased the delay to a measurable amount of ms and have multiplied by the increasing index - I know the index works as I console log out and it increases up to 100 as that is the array length.
Regardless the console.log I have in addPt happens all at the same time. What is wrong here?