What is eval()?
How to use the eval()
Only strings can be specified as arguments of the eval().
The basic syntax is:
console.log(eval("1+1")); //result //2 var test=10; console.log(eval(test+20)); //result //30
The security risks of using eval()
The eval function has the following risks:
For this reasons, it is common not to use the eval().
You can create most of the process without using the eval function.
The eval() is said to be "eval is evil".
Therefore, be sure to fully understand the risks when using it.