SOLID Principles in JavaScript: What Does the "O" Stand For?by@serhiirubets
562 reads
562 reads

SOLID Principles in JavaScript: What Does the "O" Stand For?

by Serhii Rubets3mMarch 13th, 2022
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

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.

Companies Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - SOLID Principles in JavaScript: What Does the "O" Stand For?
Serhii Rubets HackerNoon profile picture
Serhii Rubets

Serhii Rubets

@serhiirubets

I'm a Fullstack JS engineer with 10 years of experience. Also, I'm a mentor, teacher, and author of front-end courses.

Learn More
LEARN MORE ABOUT @SERHIIRUBETS'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

Serhii Rubets HackerNoon profile picture
Serhii Rubets@serhiirubets
I'm a Fullstack JS engineer with 10 years of experience. Also, I'm a mentor, teacher, and author of front-end courses.

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite