diff --git a/content/snippets/js/s/complex-object-factories.md b/content/snippets/js/s/complex-object-factories.md index 1ddde74e95c..e2d9645f71a 100644 --- a/content/snippets/js/s/complex-object-factories.md +++ b/content/snippets/js/s/complex-object-factories.md @@ -739,8 +739,10 @@ export default class Factory { const data = { ...factoryBase }; desiredTraits.forEach(trait => { - if (typeof trait === 'string') Object.assign(data, traits[trait]); - else if (typeof trait === 'object') Object.assign(data, trait); + if (typeof trait === 'string') + Object.assign(data, traits[trait]); + else if (typeof trait === 'object') + Object.assign(data, trait); else if (typeof trait === 'function') Object.assign(data, trait(data)); });