forEach iterates indexesno more properties. Your code:
updates["func1"] = "something";
Adds a property to the object - this, by the way, is an array - not an element of the array. In fact, this is equivalent to:
updates.func1 = "something";
If you need something like a hash map, you can use a simple object instead:
updates = {};
updates["func1"] = "something";
for…in,
Object.keys :
Object.keys(updates).forEach(function(key) {
console.log(key);
});