I have used eval() function in my code but Sonar is suggesting me to not to use eval(). What are the consequences and is there any alternative?
Asked
Active
Viewed 88 times
0
-
this should answer your question: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval#Do_not_ever_use_eval! as well as this https://stackoverflow.com/questions/86513/why-is-using-the-javascript-eval-function-a-bad-idea – Nick Parsons Feb 22 '19 at 05:55
-
duplicate of [Why is using the JavaScript eval function a bad idea?](https://stackoverflow.com/questions/86513/why-is-using-the-javascript-eval-function-a-bad-idea) – Pushkar Adhikari Feb 22 '19 at 05:56
-
Use of `eval()` depends on what _you_ are trying to achieve. – guest271314 Feb 22 '19 at 05:59