Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/basarat/typescript-book
/ bar
Function
bar
code/javascript/closure.ts:4–6 ·
view source on GitHub ↗
()
Source
from the content-addressed store, hash-verified
2
var
variableInOuterFunction = arg;
3
4
function
bar() {
5
console.log(variableInOuterFunction);
// Access a variable from the outer scope
6
}
7
8
// Call the local function to demonstrate that it has access to arg
9
bar();
Callers
1
outerFunction
Function · 0.70
Calls
1
log
Method · 0.45
Tested by
no test coverage detected