summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--javascript.html.markdown2
1 files changed, 2 insertions, 0 deletions
diff --git a/javascript.html.markdown b/javascript.html.markdown
index 348cbff5..4584a28c 100644
--- a/javascript.html.markdown
+++ b/javascript.html.markdown
@@ -271,6 +271,8 @@ permanent; // = 10
// outer function's variables, even after the outer function exits.
function sayHelloInFiveSeconds(name){
var prompt = "Hello, " + name + "!";
+ // Inner functions are put in the local scope by default, as if they were
+ // declared with 'var'.
function inner(){
alert(prompt);
}