Javascript-Observer-Pattern Example code of Observer pattern both in ES5 and in ES6 Demo: http://devacron.com/jspatterns/observer/