Created
December 19, 2017 18:02
-
-
Save AhnMo/86d031e04772c9691b0daee73c4ff3a2 to your computer and use it in GitHub Desktop.
Fucking Javascript Closure - eval
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
| var x = 'outter'; | |
| (function () { | |
| var x = 'inner'; | |
| alert(eval('x')); | |
| })(); | |
| // inner |
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
| var x = 'outter'; | |
| (function () { | |
| var x = 'inner'; | |
| var func = eval; | |
| alert(func('x')); | |
| })(); | |
| // outter |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment