I have an array like so
var updates = [];
I then add stuff to the array like this
updates["func1"] = function () { x += 5 };
When I call the functions with a for loop it works as expected
for(var update in updates) {
updates[update]();
}
But when I use the forEach it doesn't work!?
updates.forEach(function (update) {
update();
});
forEach definitely works in my browser which is google chrome, what am I doing wrong?