Hey @abhishekk861844,
This is an old unanswered query now but hopefully you got around a fix for it!
Evaluating JavaScript code from a string is hazardous. A string may consist of malicious code that will be run on the user's machine, and the scope, where eval()
was called will be exposed for possible attacks.
The most simple alternative is to use windows.Function()
. It creates a global scope function from the string.
Alternatively, eval(code) can artificially be replaced by (new Function('return '+code))()