07 Jan 2017
The strategy pattern is made up of a couple of idioms, “Composition over inheritence” and “Promises”. The strategy pattern can be used alone or part of a bigger pattern. It’s good for making code modular and reuseable without the use of inheritence. There are pitfalls to using inheritence all the time when sharing behavior such as the diamond problem. With inheritence the child class can inherit behavior that it did not intend on inheriting. If you forget to override it, then you will get an unexpected result. The strategy pattern will enforce some diversity in behavior that can be changed at runtime with no unexpected side affects.
09 Jun 2016
The title uses the common term of javascript but we’re going to be going into behavior that is implied by ecma ISO standards. So when ecma is discussed we’re articulating the expected behavior that the javascript interpreter in your browser must adhere to.