🏠 back to Observable

Execute code in non-strict mode


Is there a way to create a sandbox in a notebook where code strings can be eval()'ed in non-strict mode ?


It’s not sandboxed, but you can eval non-strict code like so:

(1, eval)("this")

If you want the code to be sandboxed, you’ll need to create a sandboxed iframe and run the code inside it.


Thanks Mike.