+ 2
Error handling?
Is there any error handling in JavaScript? I'm making a calculator that uses prompt() to get inputs. But what happens if someone inputs a string as x? The calculator wont work if someone uses 8 as the arithmetic operator. And in this course there is no error handling (try & catch).
1 Resposta
+ 2
you need to handle it by yourself using instanceof and === in some cases