Single Responsibility Principle – SOLID Principles in Javascript

The Single Responsibility Principle states that a class should have only one responsibility means that it should have only one reason to change or in other words, it should have only one job.
If your class has multiple responsibilities, it's better to split it into multiple classes to avoid the violation of single responsibility.