Skip to content

Instantly share code, notes, and snippets.

@dsimard
Created September 11, 2011 17:43
Show Gist options
  • Save dsimard/1209870 to your computer and use it in GitHub Desktop.
Save dsimard/1209870 to your computer and use it in GitHub Desktop.
Redefined undefined with a self-invoking function
<p>First, undefined is defined to <em id="step1"></em></p>
<p>Then, undefined is redefined to <em id="step2"></em></p>
$(document).ready(function() {
undefined = false; // Undefined is defined to false
$("#step1").text(undefined.toString());
(function(undefined) { $("#step2").text(typeof undefined); })(); /* self-invoking function */
});
name: Redefined undefined with a self-invoking function
authors:
- dsimard from javascriptkata
normalize_css: no
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment