Object.keys returns only an object's own properties. I ran into an issue where a service was using inheritance internally and the mockService function would not overwrite the inherited properties with _default. Explicitly specifying the inherited property worked but _default did not.
Using the 'for (var key in object)' syntax traverses the prototype chain and allows mockService to overwrite inherited properties not explicitly called out in the config with _default.
Object.keys returns only an object's own properties. I ran into an issue where a service was using inheritance internally and the mockService function would not overwrite the inherited properties with _default. Explicitly specifying the inherited property worked but _default did not.
Using the 'for (var key in object)' syntax traverses the prototype chain and allows mockService to overwrite inherited properties not explicitly called out in the config with _default.