MCPcopy Create free account
hub / github.com/ShivaBhattacharjee/KeyZen / counter

Function counter

public/code/javascript/07_arrow_closures.js:5–12  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3const multiply = (a, b) => a * b;
4
5const counter = () => {
6 let count = 0;
7 return {
8 inc: () => ++count,
9 dec: () => --count,
10 get: () => count
11 };
12};
13
14const c = counter();
15c.inc();

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected