The Observer is a design pattern where an object (known as a subject) maintains a list of objects depending on it (observers), automatically notifying them of any changes to state.
Create simple example of Observer Pattern
Be sure to have installed Node.js in your system for testing. Install dependencies:
npm install
In terminal in the folder:
npm test