The eval() function evaluates a string and executes it as if it was script
code.
eval(string) |
eval("x=10;y=20;document.write(x*y)");
document.write("
");
document.write(eval("2+2"));
document.write("
");
var x=10;
document.write(eval(x+17));
document.write("
");
The output of the code above will be:
200
4
27
eval("x=10;y=20;document.write(x*y)");
document.write("
");
document.write(eval("2+2"));
document.write("
");
var x=10;
document.write(eval(x+17));
document.write("
");
وعلى فكرة مش شرط يكون ال input بتاعها stringThe output of the code above will be:
200
4
27
لان فى لغة زى ال LISP
ممكن يكون abstract syntactic form
يارب يكون دا المطلوب ....