How do I return the last value from the new Function()
constructor? Seems eval()
does this by default, as well as vm.Script#runInContext
.
I just want to create a REPL in the browser (where I can do something like 2+2;
and it returns 4
in the output) like eval
, but without the drawbacks of eval
(local function scope access, AsyncFunction
, etc...)