📅  最后修改于: 2022-03-11 15:03:16.703000             🧑  作者: Mango
function myFunction() {
var x = 10;
var y = 20;
var res;
try {
var a = eval("x * y") + "
";
var b = eval("2 + 2") + "
";
var c = eval("x + 17") + "
";
var d = eval("x + 17 + ") + "
";
res = a + b + c;
}
catch (e) {
res = 'Expression in invalid.';
}
$("#demo").html(res);
}