Design Patterns examples written using JavaScript