some examples of javascript design patterns