Question:What is eval() in javaScript? 

Answer The eval() function evaluates or executes an argument.If the argument is an expression, eval() evaluates the expression. If the argument is one or more JavaScript statements, eval() executes the statements.
var x = 10;
var y = 20;
var a = eval("x*y") + "<br>";
var b = eval("2+2") + "<br>";
var c = eval("x+17") + "<br>";

var res = a + b + c;
The result of res will be 200 4 27 

+ Report
Total Preview: 1082
What is eval() in javaScript?
Copyright © 2024. Powered by Intellect Software Ltd