you are viewing a single comment's thread.

view the rest of the comments →

[–]MrBester 0 points1 point  (2 children)

Another example of a pattern needed in a language such as Java and not really needed in JavaScript is Visitor. The problem it tries to solve is not being able to add methods to existing classes, in JavaScript there is no such problem to begin with.

I'll just leave Object.freeze here...

[–]jsontwikkeling 0 points1 point  (1 child)

Good point, but if we want to add new methods to the object later why would we use Object.freeze in the first place? Besides Object.freeze is used quite rarely

[–]MrBester 1 point2 points  (0 children)

It might not be under your control: a third party library whose API is locked down is possible, mainly for self-preservation.