Created
September 6, 2025 08:44
-
-
Save jonrandy/9e4ee8721f1d3b1c2aabb36e980f43fb to your computer and use it in GitHub Desktop.
Schroedinger's Closure
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function makeFunction() { | |
let myVar = 123 | |
return function (s) { | |
console.log(eval(s)) | |
} | |
} | |
const func = makeFunction() | |
func('myVar + 1') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment