mohitahlawat2001 / calculator-app

https://mohitahlawat-calculator-app.netlify.app/
4 stars 23 forks source link

Handle calculator's error and prevent using eval() #30

Closed PhymasSC closed 1 year ago

PhymasSC commented 1 year ago

While we press the trigonometric function before any numbers, then followed with a number and equal sign will output an error. Instead of throwing the error screen, I added a try-catch block to display the "Error" on the calculator and also remove the use of eval() function as it is not a recommended way to do https://www.digitalocean.com/community/tutorials/js-eval#.