Is it possible to define a function run that acts like this?
    a = run('var x = 100;')
    b = run('console.log(x);') // prints 100
    c = run('y = 1;')
    d = run('console.log(y);') // prints 1
I tried several ways, using apply and passing the same context, binding a context to a function, returning a closure with a recursive call etc. but I can't seem to get anything to work.
 
     
    