An example of a Decorator pattern based on the flexibility of prototype to extend a JavaScript object. Decorating an object allows customised functions to be called before and after a method call, the real method call is wrapped between the before and after hooks. One method of Aspect-oriented programming with JavaScript