JavaScript Design Patterns: Strategy