https://www.dofactory.com/javascript/design-patterns/command JavaScript Command Design Pattern JavaScript Command The Command pattern encapsulates actions as objects. Command objects allow for loosely coupled systems by separating the objects that issue a request from the objects that actually process the request. These requests are called events an www.dofactory.com function add(x, y) { return ..