let func = new Function('a', 'b', 'return a+b'); console.log(func(1,2)) let x = 10; func = new Function('return x;'); console.log(func()); // Error: x is not defined