You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -137,8 +137,10 @@ var globalVar = "abc";
137
137
"innerArg = "+ innerArg +"\n"+
138
138
"innerFuncVar = "+ innerFuncVar +"\n"+
139
139
"globalVar = "+ globalVar);
140
-
} // end of scope innerFunction)(5); // Pass 5 as parameter
141
-
} // end of scope outerFunction )(7); // Pass 7 as parameter
140
+
// end of scope innerFunction
141
+
})(5); // Pass 5 as parameter
142
+
// end of scope outerFunction
143
+
})(7); // Pass 7 as parameter
142
144
```
143
145
144
146
`innerFunction` is closure which is defined inside `outerFunction` and has access to all variable which is declared and defined in outerFunction scope. In addition to this function defined inside function as closure has access to variable which is declared in `global namespace`.
0 commit comments