Created
September 13, 2011 13:25
-
-
Save dsimard/1213798 to your computer and use it in GitHub Desktop.
Redefine undefined outside the scope
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
<p>First, undefined is defined to <em id="step1"></em></p> | |
<p>Then, undefined is redefined to <em id="step2"></em></p> |
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
$(document).ready(function() { | |
undefined = false; | |
$("#step1").text(); | |
/* We create a self-invoking function to refefine undefined to undefined */ | |
(function() { window.undefined = undefined })(); | |
$("#step2").text(undefined); | |
}); |
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
normalize_css: no |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment