Let's say I have a user-entered string value stored in the variable f. For example:
f = "1/log(x)";
In vanilla JavaScript, I used the following operator:
f = "with (Math) {" + f + "}";
While this code worked perfectly fine in vanilla javascript, it caused issues when I switched to Vue.js and enabled strict mode. I'm not sure how to replace this operator now. Has anyone encountered this problem before and found a solution?
I tried the following approach:
let math = Math
math.f = f
console.log(f)
Unfortunately, nothing seems to be working.