DEV Community

Discussion on: How is my calculator. need some feedback and improvements in my Calculator app.

Collapse
 
alyatek profile image
alyatek

Try catching the errors, and not allowing to put more than 1 plus sign (or any other sign) in a row because it errors out and the erro SyntaxError: Unexpected token stays there while stuff is written.

Collapse
 
gitanilsen profile image
anil sen

What should I do then please suggest me If I can improve my code.

Collapse
 
alyatek profile image
alyatek

For the errors, just catch them and show an error message.
To prevent the error like 2 plus signs in a row compare the last character in the string to the one that was pressed.

Thread Thread
 
gitanilsen profile image
anil sen

Thank you for support.I really appreciate your suggestion. I will improve my code..☺️