🏠 back to Observable

Execute code in non-strict mode


#1

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


#2

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.


#3

Thanks Mike.