Closures Playground

Every makeCounter() call builds a house in Gang Kenari: call the counters, build a second, let one go. Whose piggy bank of count goes up? Pak RT at the watch…

The key idea

Every makeCounter() call builds a new scope

Try it in this playground