[Javascript] evalじゃなくて安全に任意文字列コードが実行できるnew Function()
const a = 1
const b = 2
const answer = new Function('a' , 'b' , 'return a + b')(a,b)
console.log(answer)
> 3
const a = 1
const b = 2
const answer = new Function('a' , 'b' , 'return a + b')(a,b)
console.log(answer)
> 3