You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
we are extending CaseDecorator with MacbookDecorator. As functions, they don't have any enumerable properties by their own yet. Shouldn't happen the extension in the prototype like:
Hi Addy,
I wonder why in this line of code
essential-js-design-patterns/book/snippets/01-JavaScript-Design-Patterns/12-the-decoration-pattern.es5.js
Line 255 in 21346c1
CaseDecorator
withMacbookDecorator
. As functions, they don't have any enumerable properties by their own yet. Shouldn't happen the extension in the prototype like:extend(CaseDecorator.prototype, MacbookDecorator.prototype);
because trying to do this
console.log(decoratedMacbookPro.addEngraving());
results in aTypeError: decoratedMacbookPro.addEngraving is not a function
The text was updated successfully, but these errors were encountered: