So, I created a calculator and my equals button uses the eval() function. I'm looking for an alternative to using the eval function because I keep getting security warnings about the danger of using eval. Does this mean that someone can hack my computer through my equals button?
The code can be found on line 51 of calculator base component here:
handleEquals() {
this.setState(prevState => {
return {
output: isNaN(prevState.output.toString().slice(-1))
? prevState.output
: eval(prevState.output)
}
})
}