Skip to content Skip to sidebar Skip to footer

Accessing Local Eval Inside Function Scope

Please consider the two following snippets of code: (function f() { var x; try { eval('x'); console.log('No error!'); } catch (e) { console

Solution 1:

Global functions are part of the window object. Call window.eval() instead.

Solution 2:

You should still be able to use

window.eval()

in this case

Post a Comment for "Accessing Local Eval Inside Function Scope"