Skip to main content

Practice · 1 of 2

One Variable, Many Calls

CHALLENGE
Difficulty: intermediate+25 XP

Implement MakeCounter: each call to the factory returns a FRESH Func<int> — invoking it returns 1, 2, 3, … for that instance. Two counters must not interfere. ``csharp static Func<int> MakeCounter(); ``

Back to lesson: Practice: Closure Capture Practice