Corsi registrati su
Corsi in diretta per la formazione di Front End Developer e Back End Developer
The syntax is as follows: eval(string).
Here is a series of demonstrative examples on the use of eval.
console.log(eval('2 + 13')); var x = 10; var y = 3; console.log(eval('x + y')); console.log(eval(' x / y'));
However, remember that this function is slower than the alternatives.
It can also be dangerous as it runs the code with page administrator privileges.
Some useful links
Array method and callback function