+13
Completed

Support for JavaScript

Jack Lyons 6 years ago updated by Игорь Шелопаев 5 years ago 7

Examples in JavaScript would be awesome!

Answer

+1
Answer
Completed

Good news, everyone! TypeScript examples are ready!

+4

I don't think that JavaScript is capable of composing such object-oriented software. As far as I know there are no such things like private fields or interfaces in JavaScript. I might be wrong, but I haven't figured out how to make these things in JS without lot of tweaking and hacking.

+2

Typescript, on the other hand, would be a viable alternative.

+1

Yeah, that would be cool. I think a lot of people would be interested in this 😀

+2
Started

FYI, TypeScript examples for design patterns are on the way. I think I might even be able to upload them by the end of this month.

+1
Answer
Completed

Good news, everyone! TypeScript examples are ready!

+1

At this point, we have a complete set of conceptual examples for all patterns in TS that demonstrate the essence of patterns, their structure, etc. I plan to add another set of real-world examples inspired by the real applications written in TS a little bit later.

Hi, I was also wondering how some patterns could be implemented by plain JavaScript and came across some website. There are eloquent javascript examples for all set of patterns mentioned in the book. https://www.dofactory.com/javascript/adapter-design-pattern

I would not say that all of them give best illustration how to use it in real projects but as examples how it could be technically implemented in javascript are good enough.