Learning about Design Patterns implemented in Javascript