summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--javascript.html.markdown6
1 files changed, 0 insertions, 6 deletions
diff --git a/javascript.html.markdown b/javascript.html.markdown
index 865edc36..1f188832 100644
--- a/javascript.html.markdown
+++ b/javascript.html.markdown
@@ -252,15 +252,9 @@ i // = 5 - not undefined as you'd expect in a block-scoped language
// in a web browser is always 'window'. The global object may have a
// different name in non-browser environments such as Node.js.
window.permanent = 10
- // Or, as previously mentioned, if you leave the var keyword off, a
- // global variable will be created when you assign it a value. However,
- // this behavior is frowned upon, and in fact is disallowed in "strict
- // mode".
- permanent2 = 15
})()
temporary // raises ReferenceError
permanent // = 10
-permanent2 // = 15 <-- the accidental global variable
// One of JavaScript's most powerful features is closures. If a function is
// defined inside another function, the inner function has access to all the