MCPcopy
hub / github.com/mouredev/hello-javascript / createCounter

Function createCounter

Intermediate/00-advanced-functions.js:81–87  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

79// Closures (Clausuras)
80
81function createCounter() {
82 let counter = 0
83 return function () {
84 counter++
85 console.log(`Contador: ${counter}`)
86 }
87}
88
89const counter = createCounter()
90counter()

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected