0
Is it wrong to use the eval function to compute values in a calculator JavaScript project. If it's wrong, what other can be used
2 Réponses
+ 2
You can use it, but some said that eval() can be used for hacking, so is not secure to use in code, if you dont know how to prevent it.
Al least I read this somewere on internet.
You should make your own eval function to compute values.
Here is documentation about eval, even thay said to never use eval, maybe this can help you to understand much more about it, and to see some solutions without eval:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval
+ 1
Thanks PanicS