diff options
author | Adam Brenecki <adam@brenecki.id.au> | 2013-08-14 17:20:34 +0930 |
---|---|---|
committer | Adam Brenecki <adam@brenecki.id.au> | 2013-08-14 17:20:34 +0930 |
commit | 02ea95377d4963c60a96976b4092bdcc2b638594 (patch) | |
tree | 8110d6dbc97f21e60f4f049e8b68b44581d062be | |
parent | 69c4e4e509019740cab8eb2074826b5c5c9f6ec3 (diff) |
Avoid telling people about techniques that are discouraged anyway
-rw-r--r-- | javascript.html.markdown | 6 |
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 |