Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/neetcode-gh/leetcode
/ createCounter
Function
createCounter
javascript/2620-counter.js:5–9 ·
view source on GitHub ↗
(n)
Source
from the content-addressed store, hash-verified
3
* @
return
{Function} counter
4
*/
5
var
createCounter =
function
(n) {
6
return
function
() {
7
return
n++;
8
};
9
};
10
11
/**
12
*
const
counter = createCounter(10)
Callers
1
2620-counter.js
File · 0.70
Calls
no outgoing calls
Tested by
no test coverage detected