Reverse polish notation calculator in JS