JavaScript based basic calculator