JavaScript eval() Function

Evaluate/Execute JavaScript code/expressions:

Example

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
上一篇:Python源码剖析


下一篇:HDU 2167 状压dp方格取数