Javascript code for a simple calculator