It's actually quite easy (just wrap it in try/catch block) and I already covered it in the post #3 that should be done by the end of the week (I'll update you once it's done). But, until then, here the example code you can use:
try { this.result = eval(this.result).toFixed(2); } catch () { // this.showAlert(); //show some error message }
Thank you very much!
Hey Lucien,
You're welcome! The new post in the series should be out tomorrow, where you'll see this implemented 💪
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
It's actually quite easy (just wrap it in try/catch block) and I already covered it in the post #3 that should be done by the end of the week (I'll update you once it's done). But, until then, here the example code you can use:
Thank you very much!
Hey Lucien,
You're welcome! The new post in the series should be out tomorrow, where you'll see this implemented 💪