Skip to content

Glossary: Software Design Patterns in JavaScript

Single responsibility principle (SRP)

Also written: SRP, single responsibility

The S of SOLID: a piece of code should have one reason to change. Pricing and saving labels change for different reasons, so they belong in separate functions.

Where the book teaches it

Related terms

SOLIDCohesionGod object