eval関数の使い方
eval() は文字列として表された JavaScript コードを式として評価する関数です。
具体例①
console.log(eval('2 + 2'));
// expected output: 4
具体例②
var a = 10; console.log(eval(a+20)); // expected output: 30
具体例③
console.log(eval(new String('2 + 2')));
// expected output: 2 + 2


