Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
hub
/
github.com/sudheerj/javascript-interview-questions
/ createCounter
Function
createCounter
coding-exercise/closure-counter.js:1–7 ·
view source on GitHub ↗
()
Source
from the content-addressed store, hash-verified
1
function
createCounter() {
2
let
count = 0;
3
return
function
() {
4
count++;
5
return
count;
6
};
7
}
8
9
const
counter1 = createCounter();
10
const
counter2 = createCounter();
Callers
1
closure-counter.js
File · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected