Too Long; Didn't Read
This is the second article about SOLID principles with Javascript examples. In the previous article, I described what are patterns in general, what is SOLID, and why we should use them. The Open-closed principle says: Entities (classes, modules, methods, files, etc.) should be open for extension, but closed for modification. When we need to add a new validation from an external service, we should add new logic (if/else) to getErrors function, we do the modification.
Share Your Thoughts