Simple string calculator implemented in accordance to Open/Closed Principle using JavaScript.