Loading problem…
Implement counter - create an independent counter object backed by closure state.
initialValue.0.increment(): increase by 1 and return the new value.decrement(): decrease by 1 and return the new value.const c = counter(0)
c.increment() // 1
c.increment() // 2
c.decrement() // 1const a = counter(10)
const b = counter(5)
a.increment() // 11
b.decrement() // 4