TLDR
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.via the TL;DR App
no story
Written by serhiirubets | I'm a Fullstack JS engineer with 10 years of experience.
Also, I'm a mentor, teacher, and author of front-end courses.